am4internal_webpackJsonp(["0471"],{"15tG":function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}},"2gqV":function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",function(){return s});var i=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],a=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function o(t,e,n,i,a){if("string"==typeof t&&(t=document.getElementById(t)),!(t&&"object"===r(t)&&"getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var o=t.getContext("2d");try{return o.getImageData(e,n,i,a)}catch(t){throw new Error("unable to access image data: "+t)}}function s(t,e,n,r,s,h){if(!(isNaN(h)||h<1)){h|=0;var l=o(t,e,n,r,s);l=function(t,e,n,r,o,s){var h,l,c,f,g,d,y,p,v,m,x,b,w,k,S,P,A,C,E,M,T,V,L,O,N,z=t.data,B=2*s+1,D=r-1,R=o-1,F=s+1,I=F*(F+1)/2,j=new u,q=j;for(c=1;c<B;c++)q=q.next=new u,c===F&&(N=q);q.next=j;var G=null,_=null;y=d=0;var $=i[s],X=a[s];for(l=0;l<o;l++){for(P=A=C=E=p=v=m=x=0,b=F*(M=z[d]),w=F*(T=z[d+1]),k=F*(V=z[d+2]),S=F*(L=z[d+3]),p+=I*M,v+=I*T,m+=I*V,x+=I*L,q=j,c=0;c<F;c++)q.r=M,q.g=T,q.b=V,q.a=L,q=q.next;for(c=1;c<F;c++)f=d+((D<c?D:c)<<2),p+=(q.r=M=z[f])*(O=F-c),v+=(q.g=T=z[f+1])*O,m+=(q.b=V=z[f+2])*O,x+=(q.a=L=z[f+3])*O,P+=M,A+=T,C+=V,E+=L,q=q.next;for(G=j,_=N,h=0;h<r;h++)z[d+3]=L=x*$>>X,0!==L?(L=255/L,z[d]=(p*$>>X)*L,z[d+1]=(v*$>>X)*L,z[d+2]=(m*$>>X)*L):z[d]=z[d+1]=z[d+2]=0,p-=b,v-=w,m-=k,x-=S,b-=G.r,w-=G.g,k-=G.b,S-=G.a,f=y+((f=h+s+1)<D?f:D)<<2,P+=G.r=z[f],A+=G.g=z[f+1],C+=G.b=z[f+2],E+=G.a=z[f+3],p+=P,v+=A,m+=C,x+=E,G=G.next,b+=M=_.r,w+=T=_.g,k+=V=_.b,S+=L=_.a,P-=M,A-=T,C-=V,E-=L,_=_.next,d+=4;y+=r}for(h=0;h<r;h++){for(A=C=E=P=v=m=x=p=0,b=F*(M=z[d=h<<2]),w=F*(T=z[d+1]),k=F*(V=z[d+2]),S=F*(L=z[d+3]),p+=I*M,v+=I*T,m+=I*V,x+=I*L,q=j,c=0;c<F;c++)q.r=M,q.g=T,q.b=V,q.a=L,q=q.next;for(g=r,c=1;c<=s;c++)d=g+h<<2,p+=(q.r=M=z[d])*(O=F-c),v+=(q.g=T=z[d+1])*O,m+=(q.b=V=z[d+2])*O,x+=(q.a=L=z[d+3])*O,P+=M,A+=T,C+=V,E+=L,q=q.next,c<R&&(g+=r);for(d=h,G=j,_=N,l=0;l<o;l++)z[(f=d<<2)+3]=L=x*$>>X,L>0?(L=255/L,z[f]=(p*$>>X)*L,z[f+1]=(v*$>>X)*L,z[f+2]=(m*$>>X)*L):z[f]=z[f+1]=z[f+2]=0,p-=b,v-=w,m-=k,x-=S,b-=G.r,w-=G.g,k-=G.b,S-=G.a,f=h+((f=l+F)<R?f:R)*r<<2,p+=P+=G.r=z[f],v+=A+=G.g=z[f+1],m+=C+=G.b=z[f+2],x+=E+=G.a=z[f+3],G=G.next,b+=M=_.r,w+=T=_.g,k+=V=_.b,S+=L=_.a,P-=M,A-=T,C-=V,E-=L,_=_.next,d+=r}return t}(l,0,0,r,s,h),t.getContext("2d").putImageData(l,e,n)}}var u=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}},"4E4r":function(t,e){t.exports=function(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var n=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(t);if(o){var s=a(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n},this.getHelpXML=function(){for(var t=new Array,r=0;r<n.length;r++)for(var i=n[r].example,a=0;a<i.length;a++)t[t.length]=i[a];for(var o in e)t[t.length]=o;var s=document.createElement("ul");s.setAttribute("id","rgbcolor-examples");for(r=0;r<t.length;r++)try{var u=document.createElement("li"),h=new RGBColor(t[r]),l=document.createElement("div");l.style.cssText="margin: 3px; border: 1px solid black; background:"+h.toHex()+"; color:"+h.toHex(),l.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[r]+" -> "+h.toRGB()+" -> "+h.toHex());u.appendChild(l),u.appendChild(c),s.appendChild(u)}catch(t){}return s}}},AKLy:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},FOhS:function(t,e,n){t.exports=n("TFFM")},GUmJ:function(t,e,n){var r=n("Lilp");function i(e,n,a){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(n):a.value}},i(e,n,a||e)}t.exports=i},Gd1W:function(t,e){function n(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise(function(i,a){var o=t.apply(e,r);function s(t){n(o,i,a,s,u,"next",t)}function u(t){n(o,i,a,s,u,"throw",t)}s(void 0)})}}},KED7:function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},Lilp:function(t,e,n){var r=n("RXKi");t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},MGDH:function(t,e,n){var r=n("KED7"),i=n("15tG"),a=n("UqQ9");t.exports=function(t,e){return r(t)||i(t,e)||a()}},QUJ4:function(t,e,n){var r=n("r1fo");t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},QXBt:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){n.d(e,"AElement",function(){return $e}),n.d(e,"AnimateColorElement",function(){return Re}),n.d(e,"AnimateElement",function(){return De}),n.d(e,"AnimateTransformElement",function(){return Fe}),n.d(e,"BoundingBox",function(){return oe}),n.d(e,"CB1",function(){return It}),n.d(e,"CB2",function(){return jt}),n.d(e,"CB3",function(){return qt}),n.d(e,"CB4",function(){return Gt}),n.d(e,"Canvg",function(){return xn}),n.d(e,"CircleElement",function(){return Se}),n.d(e,"ClipPathElement",function(){return an}),n.d(e,"DefsElement",function(){return Ve}),n.d(e,"DescElement",function(){return fn}),n.d(e,"Document",function(){return pn}),n.d(e,"Element",function(){return ne}),n.d(e,"EllipseElement",function(){return Pe}),n.d(e,"FeColorMatrixElement",function(){return en}),n.d(e,"FeCompositeElement",function(){return hn}),n.d(e,"FeDropShadowElement",function(){return sn}),n.d(e,"FeGaussianBlurElement",function(){return ln}),n.d(e,"FeMorphologyElement",function(){return un}),n.d(e,"FilterElement",function(){return on}),n.d(e,"Font",function(){return ae}),n.d(e,"FontElement",function(){return Ie}),n.d(e,"FontFaceElement",function(){return je}),n.d(e,"GElement",function(){return Le}),n.d(e,"GlyphElement",function(){return Ge}),n.d(e,"GradientElement",function(){return Oe}),n.d(e,"ImageElement",function(){return We}),n.d(e,"LineElement",function(){return Ae}),n.d(e,"LinearGradientElement",function(){return Ne}),n.d(e,"MarkerElement",function(){return Te}),n.d(e,"MaskElement",function(){return nn}),n.d(e,"Matrix",function(){return le}),n.d(e,"MissingGlyphElement",function(){return qe}),n.d(e,"Mouse",function(){return Ut}),n.d(e,"PSEUDO_ZERO",function(){return Bt}),n.d(e,"Parser",function(){return ee}),n.d(e,"PathElement",function(){return be}),n.d(e,"PathParser",function(){return xe}),n.d(e,"PatternElement",function(){return Me}),n.d(e,"Point",function(){return Yt}),n.d(e,"PolygonElement",function(){return Ee}),n.d(e,"PolylineElement",function(){return Ce}),n.d(e,"Property",function(){return Wt}),n.d(e,"QB1",function(){return _t}),n.d(e,"QB2",function(){return $t}),n.d(e,"QB3",function(){return Xt}),n.d(e,"RadialGradientElement",function(){return ze}),n.d(e,"RectElement",function(){return ke}),n.d(e,"RenderedElement",function(){return ye}),n.d(e,"Rotate",function(){return ue}),n.d(e,"SVGElement",function(){return we}),n.d(e,"SVGFontLoader",function(){return Ye}),n.d(e,"Scale",function(){return he}),n.d(e,"Screen",function(){return Kt}),n.d(e,"Skew",function(){return ce}),n.d(e,"SkewX",function(){return fe}),n.d(e,"SkewY",function(){return ge}),n.d(e,"StopElement",function(){return Be}),n.d(e,"StyleElement",function(){return Ue}),n.d(e,"SymbolElement",function(){return He}),n.d(e,"TRefElement",function(){return _e}),n.d(e,"TSpanElement",function(){return ve}),n.d(e,"TextElement",function(){return pe}),n.d(e,"TextPathElement",function(){return Xe}),n.d(e,"TitleElement",function(){return cn}),n.d(e,"Transform",function(){return de}),n.d(e,"Translate",function(){return se}),n.d(e,"UnknownElement",function(){return re}),n.d(e,"UseElement",function(){return Qe}),n.d(e,"ViewPort",function(){return Ht}),n.d(e,"compressSpaces",function(){return xt}),n.d(e,"getSelectorSpecificity",function(){return zt}),n.d(e,"normalizeAttributeName",function(){return Pt}),n.d(e,"parseExternalUrl",function(){return At}),n.d(e,"presets",function(){return bn}),n.d(e,"toNumbers",function(){return kt}),n.d(e,"trimLeft",function(){return bt}),n.d(e,"trimRight",function(){return wt}),n.d(e,"vectorMagnitude",function(){return Dt}),n.d(e,"vectorsAngle",function(){return Ft}),n.d(e,"vectorsRatio",function(){return Rt});var r=n("Q0ab"),i=(n.n(r),n("0KD/")),a=(n.n(i),n("1M4z")),o=(n.n(a),n("FE89")),s=(n.n(o),n("3Z2E")),u=(n.n(s),n("+Pwd")),h=(n.n(u),n("MGDH")),l=n.n(h),c=n("Vwc7"),f=(n.n(c),n("6Ah2")),g=(n.n(f),n("8xQt")),d=(n.n(g),n("w+oS")),y=(n.n(d),n("vIej")),p=(n.n(y),n("LoW2")),v=(n.n(p),n("g3YV")),m=(n.n(v),n("jmmR")),x=(n.n(m),n("gaw2")),b=(n.n(x),n("FOhS")),w=n.n(b),k=n("Gd1W"),S=n.n(k),P=n("l3u9"),A=n.n(P),C=n("v2Fs"),E=n.n(C),M=n("gqWF"),T=n.n(M),V=n("xv7a"),L=(n.n(V),n("LPN9")),O=(n.n(L),n("FL8s")),N=(n.n(O),n("OMnz")),z=(n.n(N),n("ywzu")),B=(n.n(z),n("MC1b")),D=(n.n(B),n("OhoW")),R=(n.n(D),n("kdhv")),F=n.n(R),I=n("DDWt"),j=(n.n(I),n("4E4r")),q=n.n(j),G=n("eYbk"),_=n.n(G),$=n("RXKi"),X=n.n($),W=n("QUJ4"),H=n.n(W),Y=n("5tyj"),U=(n.n(Y),n("nK49")),Q=(n.n(U),n("lL3t")),Z=(n.n(Q),n("1t1Z")),K=(n.n(Z),n("sSOU")),J=(n.n(K),n("kZk/")),tt=(n.n(J),n("lPoY")),et=(n.n(tt),n("lm74")),nt=(n.n(et),n("GUmJ")),rt=n.n(nt),it=n("3mR7"),at=(n.n(it),n("8Cf/")),ot=(n.n(at),n("tCdX")),st=(n.n(ot),n("/SU0")),ut=(n.n(st),n("AKLy")),ht=n.n(ut),lt=n("yBTm"),ct=(n.n(lt),n("Hp8y")),ft=(n.n(ct),n("DMUu")),gt=(n.n(ft),n("VlLm")),dt=(n.n(gt),n("uAB6")),yt=(n.n(dt),n("RlUG")),pt=(n.n(yt),n("jViO")),vt=(n.n(pt),n("olmY")),mt=(n.n(vt),n("2gqV"));function xt(t){return t.replace(/(?!\u3000)\s+/gm," ")}function bt(t){return t.replace(/^[\n \t]+/,"")}function wt(t){return t.replace(/[\n \t]+$/,"")}function kt(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var St=/^[A-Z-]+$/;function Pt(t){return St.test(t)?t.toLowerCase():t}function At(t){var e=t.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return e[2]||e[3]||e[4]}var Ct=/(\[[^\]]+\])/g,Et=/(#[^\s\+>~\.\[:]+)/g,Mt=/(\.[^\s\+>~\.\[:]+)/g,Tt=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,Vt=/(:[\w-]+\([^\)]*\))/gi,Lt=/(:[^\s\+>~\.\[:]+)/g,Ot=/([^\s\+>~\.\[:]+)/g;function Nt(t,e){var n=t.match(e);return n?[t.replace(e," "),n.length]:[t,0]}function zt(t){var e=[0,0,0],n=t.replace(/:not\(([^\)]*)\)/g,"     $1 ").replace(/{[\s\S]*/gm," "),r=0,i=Nt(n,Ct),a=l()(i,2);n=a[0],r=a[1],e[1]+=r;var o=Nt(n,Et),s=l()(o,2);n=s[0],r=s[1],e[0]+=r;var u=Nt(n,Mt),h=l()(u,2);n=h[0],r=h[1],e[1]+=r;var c=Nt(n,Tt),f=l()(c,2);n=f[0],r=f[1],e[2]+=r;var g=Nt(n,Vt),d=l()(g,2);n=d[0],r=d[1],e[1]+=r;var y=Nt(n,Lt),p=l()(y,2);n=p[0],r=p[1],e[1]+=r;var v=Nt(n=n.replace(/[\*\s\+>~]/g," ").replace(/[#\.]/g," "),Ot),m=l()(v,2);return n=m[0],r=m[1],e[2]+=r,e.join("")}var Bt=1e-8;function Dt(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function Rt(t,e){return(t[0]*e[0]+t[1]*e[1])/(Dt(t)*Dt(e))}function Ft(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Rt(t,e))}function It(t){return t*t*t}function jt(t){return 3*t*t*(1-t)}function qt(t){return 3*t*(1-t)*(1-t)}function Gt(t){return(1-t)*(1-t)*(1-t)}function _t(t){return t*t}function $t(t){return 2*t*(1-t)}function Xt(t){return(1-t)*(1-t)}!function(t,e){t(e={exports:{}},e.exports)}(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),o=new E(r||[]);return a._invoke=function(t,e,n){var r=l;return function(i,a){if(r===f)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return T()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=P(o,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=h(t,e,n);if("normal"===u.type){if(r=n.done?g:c,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}(t,n,o),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l="suspendedStart",c="suspendedYield",f="executing",g="completed",d={};function y(){}function p(){}function v(){}var m={};m[a]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(M([])));b&&b!==n&&r.call(b,a)&&(m=b);var w=v.prototype=y.prototype=Object.create(m);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,i){function a(){return new Promise(function(e,a){!function e(n,i,a,o){var s=h(t[n],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,a,o)},function(t){e("throw",t,a,o)}):Promise.resolve(l).then(function(t){u.value=t,a(u)},function(t){return e("throw",t,a,o)})}o(s.arg)}(n,i,e,a)})}return e=e?e.then(a,a):a()}}function P(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=h(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function M(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}return{next:T}}function T(){return{value:e,done:!0}}return p.prototype=w.constructor=v,v.constructor=p,v[s]=p.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i){var a=new S(u(e,n,r,i));return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(w),w[s]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=M,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),h=r.call(o,"finallyLoc");if(u&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});var Wt=function(){function t(e,n,r){E()(this,t),this.document=e,this.name=n,this.value=r}return T()(t,[{key:"hasValue",value:function(){var t=this.value;return null!==t&&""!==t&&0!==t&&void 0!==t}},{key:"isString",value:function(t){var e=this.value,n="string"==typeof e;return n&&t?t.test(e):n}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case/px$/.test(t):case/^[0-9]+$/.test(t):return!0;default:return!1}}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"getValue",value:function(t){return void 0===t||this.hasValue()?this.value:t}},{key:"getNumber",value:function(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var e=this.value,n=parseFloat(e);return this.isString(/%$/)&&(n/=100),n}},{key:"getString",value:function(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9\.\-]/g,"")}},{key:"getPixels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var n="boolean"==typeof t?[void 0,t]:[t],r=l()(n,2),i=r[0],a=r[1],o=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(o.computeSize("x"),o.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(o.computeSize("x"),o.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*o.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*o.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&a:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*o.computeSize(i);default:var s=this.getNumber();return e&&s<1?s*o.computeSize(i):s}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function(){var t=this.getString(),e=t.match(/#([^\)'"]+)/);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}},{key:"getFillStyleDefinition",value:function(t,e){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient)return n.createGradient(this.document.ctx,t,e);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var r=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),r.hasValue()&&n.getAttribute("patternTransform",!0).setValue(r.value)}return n.createPattern(this.document.ctx,t,e)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?t.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(e){for(var n=this.value,r=n.length,i=0,a=0;a<r&&(","===n[a]&&i++,3!==i);a++);if(e.hasValue()&&this.isString()&&3!==i){var o=new q.a(n);o.ok&&(n="rgba(".concat(o.r,", ").concat(o.g,", ").concat(o.b,", ").concat(e.getNumber(),")"))}return new t(this.document,this.name,n)}}],[{key:"empty",value:function(e){return new t(e,"EMPTY","")}}]),t}();Wt.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};var Ht=function(){function t(){E()(this,t),this.viewPorts=[]}return T()(t,[{key:"clear",value:function(){this.viewPorts=[]}},{key:"setCurrent",value:function(t,e){this.viewPorts.push({width:t,height:e})}},{key:"removeCurrent",value:function(){this.viewPorts.pop()}},{key:"getCurrent",value:function(){var t=this.viewPorts;return t[t.length-1]}},{key:"computeSize",value:function(t){return"number"==typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}},{key:"width",get:function(){return this.getCurrent().width}},{key:"height",get:function(){return this.getCurrent().height}}]),t}(),Yt=function(){function t(e,n){E()(this,t),this.x=e,this.y=n}return T()(t,[{key:"angleTo",value:function(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function(t){var e=this.x,n=this.y,r=e*t[0]+n*t[2]+t[4],i=e*t[1]+n*t[3]+t[5];this.x=r,this.y=i}}],[{key:"parse",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=kt(e),i=l()(r,2),a=i[0],o=void 0===a?n:a,s=i[1];return new t(o,void 0===s?n:s)}},{key:"parseScale",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=kt(e),i=l()(r,2),a=i[0],o=void 0===a?n:a,s=i[1];return new t(o,void 0===s?o:s)}},{key:"parsePath",value:function(e){for(var n=kt(e),r=n.length,i=[],a=0;a<r;a+=2)i.push(new t(n[a],n[a+1]));return i}}]),t}(),Ut=function(){function t(e){E()(this,t),this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return T()(t,[{key:"isWorking",value:function(){return this.working}},{key:"start",value:function(){if(!this.working){var t=this.screen,e=this.onClick,n=this.onMouseMove,r=t.ctx.canvas;r.onclick=e,r.onmousemove=n,this.working=!0}}},{key:"stop",value:function(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}},{key:"hasEvents",value:function(){return this.working&&this.events.length>0}},{key:"runEvents",value:function(){if(this.working){var t=this.screen,e=this.events,n=this.eventElements,r=t.ctx.canvas.style;r&&(r.cursor=""),e.forEach(function(t,e){for(var r=t.run,i=n[e];i;)r(i),i=i.parent}),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(t,e){if(this.working&&e){var n=this.events,r=this.eventElements;n.forEach(function(n,i){var a=n.x,o=n.y;!r[i]&&e.isPointInPath&&e.isPointInPath(a,o)&&(r[i]=t)})}}},{key:"checkBoundingBox",value:function(t,e){if(this.working&&e){var n=this.events,r=this.eventElements;n.forEach(function(n,i){var a=n.x,o=n.y;!r[i]&&e.isPointInBox(a,o)&&(r[i]=t)})}}},{key:"mapXY",value:function(t,e){for(var n=this.screen,r=n.window,i=n.ctx,a=new Yt(t,e),o=i.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}},{key:"onClick",value:function(t){var e=this.mapXY((t||event).clientX,(t||event).clientY),n=e.x,r=e.y;this.events.push({type:"onclick",x:n,y:r,run:function(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function(t){var e=this.mapXY((t||event).clientX,(t||event).clientY),n=e.x,r=e.y;this.events.push({type:"onmousemove",x:n,y:r,run:function(t){t.onMouseMove&&t.onMouseMove()}})}}]),t}(),Qt="undefined"!=typeof window?window:null,Zt="undefined"!=typeof fetch?fetch.bind(window):null,Kt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.fetch,i=void 0===r?Zt:r,a=n.window,o=void 0===a?Qt:a;E()(this,t),this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new Ht,this.mouse=new Ut(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=o,this.fetch=i}return T()(t,[{key:"wait",value:function(t){this.waits.push(t)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var t=this.waits.every(function(t){return t()});return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function(t){var e=t.document,n=t.ctx,r=t.aspectRatio,i=t.width,a=t.desiredWidth,o=t.height,s=t.desiredHeight,u=t.minX,h=void 0===u?0:u,c=t.minY,f=void 0===c?0:c,g=t.refX,d=t.refY,y=t.clip,p=void 0!==y&&y,v=t.clipX,m=void 0===v?0:v,x=t.clipY,b=void 0===x?0:x,w=xt(r).replace(/^defer\s/,"").split(" "),k=l()(w,2),S=k[0],P=k[1],A=S||"xMidYMid",C=P||"meet",E=i/a,M=o/s,T=Math.min(E,M),V=Math.max(E,M),L=a,O=s;"meet"===C&&(L*=T,O*=T),"slice"===C&&(L*=V,O*=V);var N=new Wt(e,"refX",g),z=new Wt(e,"refY",d),B=N.hasValue()&&z.hasValue();if(B&&n.translate(-T*N.getPixels("x"),-T*z.getPixels("y")),p){var D=T*m,R=T*b;n.beginPath(),n.moveTo(D,R),n.lineTo(i,R),n.lineTo(i,o),n.lineTo(D,o),n.closePath(),n.clip()}if(!B){var F="meet"===C&&T===M,I="slice"===C&&V===M,j="meet"===C&&T===E,q="slice"===C&&V===E;/^xMid/.test(A)&&(F||I)&&n.translate(i/2-L/2,0),/YMid$/.test(A)&&(j||q)&&n.translate(0,o/2-O/2),/^xMax/.test(A)&&(F||I)&&n.translate(i-L,0),/YMax$/.test(A)&&(j||q)&&n.translate(0,o-O)}switch(!0){case"none"===A:n.scale(E,M);break;case"meet"===C:n.scale(T,T);break;case"slice"===C:n.scale(V,V)}n.translate(-h,-f)}},{key:"start",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.enableRedraw,i=void 0!==r&&r,a=n.ignoreMouse,o=void 0!==a&&a,s=n.ignoreAnimation,u=void 0!==s&&s,h=n.ignoreDimensions,l=void 0!==h&&h,c=n.ignoreClear,f=void 0!==c&&c,g=n.forceRedraw,d=n.scaleWidth,y=n.scaleHeight,p=n.offsetX,v=n.offsetY,m=this.FRAMERATE,x=this.mouse,b=1e3/m;if(this.frameDuration=b,this.readyPromise=new Promise(function(t){e.resolveReady=t}),this.isReady()&&this.render(t,l,f,d,y,p,v),i){var w=Date.now(),k=w,S=0;o||x.start(),this.intervalId=F()(function n(){w=Date.now(),(S=w-k)>=b&&(k=w-S%b,e.shouldUpdate(u,g)&&(e.render(t,l,f,d,y,p,v),x.runEvents())),e.intervalId=F()(n)})}}},{key:"stop",value:function(){this.intervalId&&(F.a.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(t,e){if(!t){var n=this.frameDuration,r=this.animations.reduce(function(t,e){return e.update(n)||t},!1);if(r)return!0}return!("function"!=typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(t,e,n,r,i,a,o){var s=this.CLIENT_WIDTH,u=this.CLIENT_HEIGHT,h=this.viewPort,l=this.ctx,c=this.isFirstRender,f=l.canvas;h.clear(),f.width&&f.height?h.setCurrent(f.width,f.height):h.setCurrent(s,u);var g=t.getStyle("width"),d=t.getStyle("height");!e&&(c||"number"!=typeof r&&"number"!=typeof i)&&(g.hasValue()&&(f.width=g.getPixels("x"),f.style&&(f.style.width="".concat(f.width,"px"))),d.hasValue()&&(f.height=d.getPixels("y"),f.style&&(f.style.height="".concat(f.height,"px"))));var y=f.clientWidth||f.width,p=f.clientHeight||f.height;if(e&&g.hasValue()&&d.hasValue()&&(y=g.getPixels("x"),p=d.getPixels("y")),h.setCurrent(y,p),"number"==typeof a&&t.getAttribute("x",!0).setValue(a),"number"==typeof o&&t.getAttribute("y",!0).setValue(o),"number"==typeof r||"number"==typeof i){var v=kt(t.getAttribute("viewBox").getString()),m=0,x=0;if("number"==typeof r){var b=t.getStyle("width");b.hasValue()?m=b.getPixels("x")/r:isNaN(v[2])||(m=v[2]/r)}if("number"==typeof i){var w=t.getStyle("height");w.hasValue()?x=w.getPixels("y")/i:isNaN(v[3])||(x=v[3]/i)}m||(m=x),x||(x=m),t.getAttribute("width",!0).setValue(r),t.getAttribute("height",!0).setValue(i);var k=t.getStyle("transform",!0,!0);k.setValue("".concat(k.getString()," scale(").concat(1/m,", ").concat(1/x,")"))}n||l.clearRect(0,0,y,p),t.render(l),c&&(this.isFirstRender=!1)}}]),t}();Kt.defaultWindow=Qt,Kt.defaultFetch=Zt;var Jt=Kt.defaultFetch,te="undefined"!=typeof DOMParser?DOMParser:null,ee=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.fetch,r=void 0===n?Jt:n,i=e.DOMParser,a=void 0===i?te:i;E()(this,t),this.fetch=r,this.DOMParser=a}return T()(t,[{key:"parse",value:function(){var t=S()(w.a.mark(function t(e){return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!/^</.test(e)){t.next=2;break}return t.abrupt("return",this.parseFromString(e));case 2:return t.abrupt("return",this.load(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"parseFromString",value:function(t){try{return(new this.DOMParser).parseFromString(t,"image/svg+xml")}catch(e){return(new this.DOMParser).parseFromString(t,"text/xml")}}},{key:"load",value:function(){var t=S()(w.a.mark(function t(e){var n,r;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.fetch(e);case 2:return n=t.sent,t.next=5,n.text();case 5:return r=t.sent,t.abrupt("return",this.parseFromString(r));case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}]),t}(),ne=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(E()(this,t),this.document=e,this.node=n,this.captureTextNodes=i,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],n&&1===n.nodeType){if(Array.from(n.attributes).forEach(function(t){var n=Pt(t.nodeName);r.attributes[n]=new Wt(e,n,t.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue())this.getAttribute("style").getString().split(";").map(function(t){return t.trim()}).forEach(function(t){if(t){var n=t.split(":"),i=l()(n,2),a=i[0],o=i[1];r.styles[a]=new Wt(e,a.trim(),o.trim())}});var a=e.definitions,o=this.getAttribute("id");o.hasValue()&&(a[o.getValue()]||(a[o.getValue()]=this)),Array.from(n.childNodes).forEach(function(t){if(1===t.nodeType)r.addChild(t);else if(i&&(3===t.nodeType||4===t.nodeType)){var n=e.createTextNode(t);n.getText().length>0&&r.addChild(n)}})}}return T()(t,[{key:"getAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attributes[t];if(!n&&e){var r=new Wt(this.document,t,"");return this.attributes[t]=r,r}return n||Wt.empty(this.document)}},{key:"getHrefAttribute",value:function(){for(var t in this.attributes)if("href"===t||/:href$/.test(t))return this.attributes[t];return Wt.empty(this.document)}},{key:"getStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[t];if(r)return r;var i=this.getAttribute(t);if(i&&i.hasValue())return this.styles[t]=i,i;if(!n){var a=this.parent;if(a){var o=a.getStyle(t);if(o&&o.hasValue())return o}}if(e){var s=new Wt(this.document,t,"");return this.styles[t]=s,s}return r||Wt.empty(this.document)}},{key:"render",value:function(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&e.apply(t,this)}else if("none"!==this.getStyle("filter").getValue("none")){var n=this.getStyle("filter").getDefinition();n&&n.apply(t,this)}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function(t){}},{key:"clearContext",value:function(t){}},{key:"renderChildren",value:function(t){this.children.forEach(function(e){e.render(t)})}},{key:"addChild",value:function(e){var n=e instanceof t?e:this.document.createElement(e);n.parent=this,t.ignoreChildTypes.includes(n.type)||this.children.push(n)}},{key:"matchesSelector",value:function(t){var e=this.node;if("function"==typeof e.matches)return e.matches(t);var n=e.getAttribute("class");return!(!n||""===n)&&n.split(" ").some(function(e){if(".".concat(e)===t)return!0})}},{key:"addStylesFromStyleDefinition",value:function(){var t=this.document,e=t.styles,n=t.stylesSpecificity;for(var r in e)if("@"!==r[0]&&this.matchesSelector(r)){var i=e[r],a=n[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];void 0===s&&(s="000"),a>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=a)}}}}]),t}();ne.ignoreChildTypes=["title"];var re=function(t){function e(t,n,r){var i;return E()(this,e),i=_()(this,X()(e).call(this,t,n,r)),console.warn("Element ".concat(n.nodeName," not yet implemented.")),i}return H()(e,t),e}(ne);function ie(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}var ae=function(){function e(t,n,r,i,a,o){E()(this,e);var s=o?"string"==typeof o?e.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=n||s.fontVariant}return T()(e,[{key:"toString",value:function(){return[function(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}(this.fontStyle),this.fontVariant,function(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}(this.fontWeight),this.fontSize,function(e){return void 0===t?e:e.trim().split(",").map(ie).join(",")}(this.fontFamily)].join(" ").trim()}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r="",i="",a="",o="",s="",u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return xt(t).trim().split(" ").forEach(function(t){switch(!0){case!u.fontStyle&&e.styles.includes(t):"inherit"!==t&&(r=t),u.fontStyle=!0;break;case!u.fontVariant&&e.variants.includes(t):"inherit"!==t&&(i=t),u.fontStyle=!0,u.fontVariant=!0;break;case!u.fontWeight&&e.weights.includes(t):"inherit"!==t&&(a=t),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:if("inherit"!==t){var n=t.split("/"),h=l()(n,1);o=h[0]}u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:"inherit"!==t&&(s+=t)}}),new e(r,i,a,o,s,n)}}]),e}();ae.styles="normal|italic|oblique|inherit",ae.variants="normal|small-caps|inherit",ae.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var oe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;E()(this,t),this.x1=e,this.y1=n,this.x2=r,this.y2=i,this.addPoint(e,n),this.addPoint(r,i)}return T()(t,[{key:"addPoint",value:function(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}},{key:"addX",value:function(t){this.addPoint(t,null)}},{key:"addY",value:function(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function(t){if(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;this.addPoint(e,n),this.addPoint(r,i)}}},{key:"sumCubic",value:function(t,e,n,r,i){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*n+3*(1-t)*Math.pow(t,2)*r+Math.pow(t,3)*i}},{key:"bezierCurveAdd",value:function(t,e,n,r,i){var a=6*e-12*n+6*r,o=-3*e+9*n-9*r+3*i,s=3*n-3*e;if(0!==o){var u=Math.pow(a,2)-4*s*o;if(!(u<0)){var h=(-a+Math.sqrt(u))/(2*o);0<h&&h<1&&(t?this.addX(this.sumCubic(h,e,n,r,i)):this.addY(this.sumCubic(h,e,n,r,i)));var l=(-a-Math.sqrt(u))/(2*o);0<l&&l<1&&(t?this.addX(this.sumCubic(l,e,n,r,i)):this.addY(this.sumCubic(l,e,n,r,i)))}}else{if(0===a)return;var c=-s/a;0<c&&c<1&&(t?this.addX(this.sumCubic(c,e,n,r,i)):this.addY(this.sumCubic(c,e,n,r,i)))}}},{key:"addBezierCurve",value:function(t,e,n,r,i,a,o,s){this.addPoint(t,e),this.addPoint(o,s),this.bezierCurveAdd(!0,t,n,i,o),this.bezierCurveAdd(!1,e,r,a,s)}},{key:"addQuadraticCurve",value:function(t,e,n,r,i,a){var o=t+2/3*(n-t),s=e+2/3*(r-e),u=o+1/3*(i-t),h=s+1/3*(a-e);this.addBezierCurve(t,e,o,u,s,h,i,a)}},{key:"isPointInBox",value:function(t,e){var n=this.x1,r=this.y1,i=this.x2,a=this.y2;return n<=t&&t<=i&&r<=e&&e<=a}},{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}}]),t}(),se=function(){function t(e,n){E()(this,t),this.type="translate",this.point=null,this.point=Yt.parse(n)}return T()(t,[{key:"apply",value:function(t){var e=this.point,n=e.x,r=e.y;t.translate(n||0,r||0)}},{key:"unapply",value:function(t){var e=this.point,n=e.x,r=e.y;t.translate(-1*n||0,-1*r||0)}},{key:"applyToPoint",value:function(t){var e=this.point,n=e.x,r=e.y;t.applyTransform([1,0,0,1,n||0,r||0])}}]),t}(),ue=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];E()(this,t),this.type="rotate",this.angle=null,this.cx=0,this.cy=0;var i=kt(n);this.angle=new Wt(e,"angle",i[0]),this.cx=(i[1]||0)+(r[0]||0),this.cy=(i[2]||0)+(r[1]||0)}return T()(t,[{key:"apply",value:function(t){var e=this.cx,n=this.cy,r=this.angle;t.translate(e,n),t.rotate(r.getRadians()),t.translate(-e,-n)}},{key:"unapply",value:function(t){var e=this.cx,n=this.cy,r=this.angle;t.translate(e,n),t.rotate(-1*r.getRadians()),t.translate(-e,-n)}},{key:"applyToPoint",value:function(t){var e=this.cx,n=this.cy,r=this.angle.getRadians();t.applyTransform([1,0,0,1,e||0,n||0]),t.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),t.applyTransform([1,0,0,1,-e||0,-n||0])}}]),t}(),he=function(){function t(e,n){E()(this,t),this.type="scale",this.scale=null;var r=Yt.parseScale(n);0!==r.x&&0!==r.y||(r.x=Bt,r.y=Bt),this.scale=r}return T()(t,[{key:"apply",value:function(t){var e=this.scale,n=e.x,r=e.y;t.scale(n,r||n)}},{key:"unapply",value:function(t){var e=this.scale,n=e.x,r=e.y;t.scale(1/n,1/r||n)}},{key:"applyToPoint",value:function(t){var e=this.scale,n=e.x,r=e.y;t.applyTransform([n||0,0,0,r||0,0,0])}}]),t}(),le=function(){function t(e,n){E()(this,t),this.type="matrix",this.matrix=[],this.matrix=kt(n)}return T()(t,[{key:"apply",value:function(t){var e=this.matrix;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}},{key:"unapply",value:function(t){var e=this.matrix,n=e[0],r=e[2],i=e[4],a=e[1],o=e[3],s=e[5],u=1/(n*(1*o-0*s)-r*(1*a-0*s)+i*(0*a-0*o));t.transform(u*(1*o-0*s),u*(0*s-1*a),u*(0*i-1*r),u*(1*n-0*i),u*(r*s-i*o),u*(i*a-n*s))}},{key:"applyToPoint",value:function(t){t.applyTransform(this.matrix)}}]),t}(),ce=function(t){function e(t,n){var r;return E()(this,e),(r=_()(this,X()(e).call(this,t,n))).type="skew",r.angle=null,r.angle=new Wt(t,"angle",n),r}return H()(e,t),e}(le),fe=function(t){function e(t,n){var r;return E()(this,e),(r=_()(this,X()(e).call(this,t,n))).type="skewX",r.matrix=[1,0,Math.tan(r.angle.getRadians()),1,0,0],r}return H()(e,t),e}(ce),ge=function(t){function e(t,n){var r;return E()(this,e),(r=_()(this,X()(e).call(this,t,n))).type="skewY",r.matrix=[1,Math.tan(r.angle.getRadians()),0,1,0,0],r}return H()(e,t),e}(ce);var de=function(){function t(e,n,r){var i=this;E()(this,t),this.document=e,this.transforms=[];var a=function(t){return xt(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(n),o=r?kt(r):[];a.forEach(function(e){if("none"!==e){var n=function(t){var e=t.split("("),n=l()(e,2),r=n[0],i=n[1];return[r.trim(),i.trim().replace(")","")]}(e),r=l()(n,2),a=r[0],s=r[1],u=t.transformTypes[a];void 0!==u&&i.transforms.push(new u(i.document,s,o))}})}return T()(t,[{key:"apply",value:function(t){for(var e=this.transforms,n=e.length,r=0;r<n;r++)e[r].apply(t)}},{key:"unapply",value:function(t){for(var e=this.transforms,n=e.length-1;n>=0;n--)e[n].unapply(t)}},{key:"applyToPoint",value:function(t){for(var e=this.transforms,n=e.length,r=0;r<n;r++)e[r].applyToPoint(t)}}],[{key:"fromElement",value:function(e,n){var r=n.getStyle("transform",!1,!0),i=n.getStyle("transform-origin",!1,!0);return r.hasValue()?new t(e,r.getString(),i.getString()):null}}]),t}();de.transformTypes={translate:se,rotate:ue,scale:he,matrix:le,skewX:fe,skewY:ge};var ye=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).modifiedEmSizeStack=!1,t}return H()(e,t),T()(e,[{key:"calculateOpacity",value:function(){for(var t=1,e=this;e;){var n=e.getStyle("opacity",!1,!0);n.hasValue()&&(t*=n.getNumber()),e=e.parent}return t}},{key:"setContext",value:function(t){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){var e=this.getStyle("fill"),n=this.getStyle("fill-opacity"),r=this.getStyle("stroke"),i=this.getStyle("stroke-opacity");if(e.isUrlDefinition()){var a=e.getFillStyleDefinition(this,n);a&&(t.fillStyle=a)}else if(e.hasValue()){"currentColor"===e.getString()&&e.setValue(this.getStyle("color").getValue());var o=e.getString();"inherit"!==o&&(t.fillStyle="none"===o?"rgba(0,0,0,0)":o)}if(n.hasValue()){var s=new Wt(this.document,"fill",t.fillStyle).addOpacity(n).getString();t.fillStyle=s}if(r.isUrlDefinition()){var u=r.getFillStyleDefinition(this,i);u&&(t.strokeStyle=u)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getValue());var h=r.getString();"inherit"!==h&&(t.strokeStyle="none"===h?"rgba(0,0,0,0)":h)}if(i.hasValue()){var l=new Wt(this.document,"stroke",t.strokeStyle).addOpacity(i).getString();t.strokeStyle=l}var c=this.getStyle("stroke-width");if(c.hasValue()){var f=c.getPixels();t.lineWidth=f||Bt}var g=this.getStyle("stroke-linecap"),d=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),p=this.getStyle("paint-order"),v=this.getStyle("stroke-dasharray"),m=this.getStyle("stroke-dashoffset");if(g.hasValue()&&(t.lineCap=g.getString()),d.hasValue()&&(t.lineJoin=d.getString()),y.hasValue()&&(t.miterLimit=y.getNumber()),p.hasValue()&&(t.paintOrder=p.getValue()),v.hasValue()&&"none"!==v.getString()){var x=kt(v.getString());void 0!==t.setLineDash?t.setLineDash(x):void 0!==t.webkitLineDash?t.webkitLineDash=x:void 0===t.mozDash||1===x.length&&0===x[0]||(t.mozDash=x);var b=m.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=b:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=b:void 0!==t.mozDashOffset&&(t.mozDashOffset=b)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var w=this.getStyle("font"),k=this.getStyle("font-style"),S=this.getStyle("font-variant"),P=this.getStyle("font-weight"),A=this.getStyle("font-size"),C=this.getStyle("font-family"),E=new ae(k.getString(),S.getString(),P.getString(),A.hasValue()?"".concat(A.getPixels(!0),"px"):"",C.getString(),ae.parse(w.getString(),t.font));k.setValue(E.fontStyle),S.setValue(E.fontVariant),P.setValue(E.fontWeight),A.setValue(E.fontSize),C.setValue(E.fontFamily),t.font=E.toString(),A.isPixels()&&(this.document.emSize=A.getPixels(),this.modifiedEmSizeStack=!0)}var M=de.fromElement(this.document,this);M&&M.apply(t);var T=this.getStyle("clip-path",!1,!0);if(T.hasValue()){var V=T.getDefinition();V&&V.apply(t)}t.globalAlpha=this.calculateOpacity()}},{key:"clearContext",value:function(t){rt()(X()(e.prototype),"clearContext",this).call(this,t),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),e}(ne),pe=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,(this instanceof e?this.constructor:void 0)===e||r))).type="text",i.x=0,i.y=0,i.measureCache=-1,i}return H()(e,t),T()(e,[{key:"setContext",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];rt()(X()(e.prototype),"setContext",this).call(this,t,n);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(t.textBaseline=r)}},{key:"initializeCoordinates",value:function(t){this.x=this.getAttribute("x").getPixels("x"),this.y=this.getAttribute("y").getPixels("y");var e=this.getAttribute("dx"),n=this.getAttribute("dy");e.hasValue()&&(this.x+=e.getPixels("x")),n.hasValue()&&(this.y+=n.getPixels("y")),this.x+=this.getAnchorDelta(t,this,0)}},{key:"getBoundingBox",value:function(t){var e=this;if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(t);var n=null;return this.children.forEach(function(r,i){var a=e.getChildBoundingBox(t,e,e,i);n?n.addBoundingBox(a):n=a}),n}},{key:"getFontSize",value:function(){var t=this.document,e=this.parent,n=ae.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(n)}},{key:"getTElementBoundingBox",value:function(t){var e=this.getFontSize();return new oe(this.x,this.y-e,this.x+this.measureText(t),this.y)}},{key:"getGlyph",value:function(t,e,n){var r=e[n],i=null;if(t.isArabic){var a=e.length,o=e[n-1],s=e[n+1],u="isolated";(0===n||" "===o)&&n<a-2&&" "!==s&&(u="terminal"),n>0&&" "!==o&&n<a-2&&" "!==s&&(u="medial"),n>0&&" "!==o&&(n===a-1||" "===s)&&(u="initial"),void 0!==t.glyphs[r]&&((i=t.glyphs[r][u])||"glyph"!==t.glyphs[r].type||(i=t.glyphs[r]))}else i=t.glyphs[r];return i||(i=t.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(t){var e=t||this.node,n=Array.from(e.parentNode.childNodes),r=n.indexOf(e),i=n.length-1,a=xt(e.value||e.text||e.textContent||"");return 0===r&&(a=bt(a)),r===i&&(a=wt(a)),a}},{key:"renderChildren",value:function(t){var e=this;if("text"===this.type){this.initializeCoordinates(t),this.children.forEach(function(n,r){e.renderChild(t,e,e,r)});var n=this.document.screen.mouse;n.isWorking()&&n.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}},{key:"renderTElementChildren",value:function(t){var e=this.document,n=this.parent,r=this.getText(),i=n.getStyle("font-family").getDefinition();if(i)for(var a=i.fontFace.unitsPerEm,o=ae.parse(e.ctx.font),s=n.getStyle("font-size").getNumber(o.fontSize),u=n.getStyle("font-style").getString(o.fontStyle),h=s/a,l=i.isRTL?r.split("").reverse().join(""):r,c=kt(n.getAttribute("dx").getString()),f=l.length,g=0;g<f;g++){var d=this.getGlyph(i,l,g);t.translate(this.x,this.y),t.scale(h,-h);var y=t.lineWidth;t.lineWidth=t.lineWidth*a/s,"italic"===u&&t.transform(1,0,.4,1,0,0),d.render(t),"italic"===u&&t.transform(1,0,-.4,1,0,0),t.lineWidth=y,t.scale(1/h,-1/h),t.translate(-this.x,-this.y),this.x+=s*(d.horizAdvX||i.horizAdvX)/a,void 0===c[g]||isNaN(c[g])||(this.x+=c[g])}else{var p=this.x,v=this.y;"stroke"===t.paintOrder?(t.strokeStyle&&t.strokeText(r,p,v),t.fillStyle&&t.fillText(r,p,v)):(t.fillStyle&&t.fillText(r,p,v),t.strokeStyle&&t.strokeText(r,p,v))}}},{key:"getAnchorDelta",value:function(t,e,n){var r=this.getStyle("text-anchor").getString("start");if("start"!==r){for(var i=e.children,a=i.length,o=null,s=0,u=n;u<a&&(o=i[u],!(u>n&&o.getAttribute("x").hasValue()||o.getAttribute("text-anchor").hasValue()));u++)s+=o.measureTextRecursive(t);return-1*("end"===r?s:s/2)}return 0}},{key:"adjustChildCoordinates",value:function(t,e,n,r){var i=n.children[r];if("function"!=typeof i.measureText)return i;var a=i.getAttribute("x"),o=i.getAttribute("y"),s=i.getAttribute("dx"),u=i.getAttribute("dy"),h=i.getAttribute("text-anchor").getString("start");if(0===r&&"textNode"!==i.type&&(a.hasValue()||a.setValue(e.getAttribute("x").getValue("0")),o.hasValue()||o.setValue(e.getAttribute("y").getValue("0")),s.hasValue()||s.setValue(e.getAttribute("dx").getValue("0")),u.hasValue()||u.setValue(e.getAttribute("dy").getValue("0"))),a.hasValue()){if(i.x=a.getPixels("x")+e.getAnchorDelta(t,n,r),"start"!==h){var l=i.measureTextRecursive(t);i.x+=-1*("end"===h?l:l/2)}s.hasValue()&&(i.x+=s.getPixels("x"))}else{if("start"!==h){var c=i.measureTextRecursive(t);e.x+=-1*("end"===h?c:c/2)}s.hasValue()&&(e.x+=s.getPixels("x")),i.x=e.x}return e.x=i.x+i.measureText(t),o.hasValue()?(i.y=o.getPixels("y"),u.hasValue()&&(i.y+=u.getPixels("y"))):(u.hasValue()&&(e.y+=u.getPixels("y")),i.y=e.y),e.y=i.y,i}},{key:"getChildBoundingBox",value:function(t,e,n,r){var i=this.adjustChildCoordinates(t,e,n,r),a=i.getBoundingBox(t);return a?(i.children.forEach(function(n,r){var o=e.getChildBoundingBox(t,e,i,r);a.addBoundingBox(o)}),a):null}},{key:"renderChild",value:function(t,e,n,r){var i=this.adjustChildCoordinates(t,e,n,r);i.render(t),i.children.forEach(function(n,r){e.renderChild(t,e,i,r)})}},{key:"measureTextRecursive",value:function(t){return this.children.reduce(function(e,n){return e+n.measureTextRecursive(t)},this.measureText(t))}},{key:"measureText",value:function(t){var e=this.measureCache;if(~e)return e;var n=this.getText(),r=this.measureTargetText(t,n);return this.measureCache=r,r}},{key:"measureTargetText",value:function(t,e){if(!e.length)return 0;var n=this.parent,r=n.getStyle("font-family").getDefinition();if(r){for(var i=this.getFontSize(),a=r.isRTL?e.split("").reverse().join(""):e,o=kt(n.getAttribute("dx").getString()),s=a.length,u=0,h=0;h<s;h++){u+=(this.getGlyph(r,a,h).horizAdvX||r.horizAdvX)*i/r.fontFace.unitsPerEm,void 0===o[h]||isNaN(o[h])||(u+=o[h])}return u}if(!t.measureText)return 10*e.length;t.save(),this.setContext(t,!0);var l=t.measureText(e).width;return t.restore(),l}}]),e}(ye),ve=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,(this instanceof e?this.constructor:void 0)===e||r))).type="tspan",i.text=i.children.length>0?"":i.getTextFromNode(),i}return H()(e,t),T()(e,[{key:"getText",value:function(){return this.text}}]),e}(pe),me=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="textNode",t}return H()(e,t),e}(ve);var xe=function(){function t(e){E()(this,t),this.control=null,this.start=null,this.current=null,this.command="",this.tokens=[],this.i=-1,this.previousCommand="",this.points=[],this.angles=[],this.tokens=function(t){return xt(t.replace(/,/gm," ").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([0-9])([+\-])/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ")).trim()}(e).split(" ")}return T()(t,[{key:"reset",value:function(){this.i=-1,this.command="",this.previousCommand="",this.start=new Yt(0,0),this.control=new Yt(0,0),this.current=new Yt(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function(){return this.i>=this.tokens.length-1}},{key:"isCommandOrEnd",value:function(){if(this.isEnd())return!0;var t=this.i,e=this.tokens;return/^[A-Za-z]$/.test(e[t+1])}},{key:"isRelativeCommand",value:function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0;default:return!1}}},{key:"getToken",value:function(){return this.i++,this.tokens[this.i]}},{key:"getScalar",value:function(){return parseFloat(this.getToken())}},{key:"nextCommand",value:function(){this.previousCommand=this.command,this.command=this.getToken()}},{key:"getPoint",value:function(){var t=new Yt(this.getScalar(),this.getScalar());return this.makeAbsolute(t)}},{key:"getAsControlPoint",value:function(){var t=this.getPoint();return this.control=t,t}},{key:"getAsCurrentPoint",value:function(){var t=this.getPoint();return this.current=t,t}},{key:"getReflectedControlPoint",value:function(){var t=this.previousCommand.toLowerCase();if("c"!==t&&"s"!==t&&"q"!==t&&"t"!==t)return this.current;var e=this.current,n=e.x,r=e.y,i=this.control,a=i.x,o=i.y;return new Yt(2*n-a,2*r-o)}},{key:"makeAbsolute",value:function(t){if(this.isRelativeCommand()){var e=this.current,n=e.x,r=e.y;t.x+=n,t.y+=r}return t}},{key:"addMarker",value:function(t,e,n){var r=this.points,i=this.angles;n&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=r[r.length-1].angleTo(n)),this.addMarkerAngle(t,e?e.angleTo(t):null)}},{key:"addMarkerAngle",value:function(t,e){this.points.push(t),this.angles.push(e)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var t=this.angles,e=t.length,n=0;n<e;n++)if(!t[n])for(var r=n+1;r<e;r++)if(t[r]){t[n]=t[r];break}return t}}]),t}(),be=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="path",i.pathParser=null,i.pathParser=new xe(i.getAttribute("d").getString()),i}return H()(e,t),T()(e,[{key:"path",value:function(t){var e=this.pathParser,n=new oe;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.nextCommand(),e.command){case"M":case"m":this.pathM(t,n);break;case"L":case"l":this.pathL(t,n);break;case"H":case"h":this.pathH(t,n);break;case"V":case"v":this.pathV(t,n);break;case"C":case"c":this.pathC(t,n);break;case"S":case"s":this.pathS(t,n);break;case"Q":case"q":this.pathQ(t,n);break;case"T":case"t":this.pathT(t,n);break;case"A":case"a":this.pathA(t,n);break;case"Z":case"z":this.pathZ(t,n)}return n}},{key:"getBoundingBox",value:function(t){return this.path()}},{key:"getMarkers",value:function(){var t=this.pathParser,e=t.getMarkerPoints(),n=t.getMarkerAngles();return e.map(function(t,e){return[t,n[e]]})}},{key:"renderChildren",value:function(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&t.stroke();var n=this.getMarkers();if(n){var r=n.length-1,i=this.getStyle("marker-start"),a=this.getStyle("marker-mid"),o=this.getStyle("marker-end");if(i.isUrlDefinition()){var s=i.getDefinition(),u=l()(n[0],2),h=u[0],c=u[1];s.render(t,h,c)}if(a.isUrlDefinition())for(var f=a.getDefinition(),g=1;g<r;g++){var d=l()(n[g],2),y=d[0],p=d[1];f.render(t,y,p)}if(o.isUrlDefinition()){var v=o.getDefinition(),m=l()(n[r],2),x=m[0],b=m[1];v.render(t,x,b)}}}},{key:"pathM",value:function(t,e){var n=this.pathParser,r=n.getAsCurrentPoint(),i=r.x,a=r.y;for(n.addMarker(r),e.addPoint(i,a),t&&t.moveTo(i,a),n.start=n.current;!n.isCommandOrEnd();){var o=n.getAsCurrentPoint(),s=o.x,u=o.y;n.addMarker(o,n.start),e.addPoint(s,u),t&&t.lineTo(s,u)}}},{key:"pathL",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getAsCurrentPoint(),a=i.x,o=i.y;n.addMarker(i,r),e.addPoint(a,o),t&&t.lineTo(a,o)}}},{key:"pathH",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=new Yt((n.isRelativeCommand()?r.x:0)+n.getScalar(),r.y);n.addMarker(i,r),n.current=i,e.addPoint(i.x,i.y),t&&t.lineTo(i.x,i.y)}}},{key:"pathV",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=new Yt(r.x,(n.isRelativeCommand()?r.y:0)+n.getScalar());n.addMarker(i,r),n.current=i,e.addPoint(i.x,i.y),t&&t.lineTo(i.x,i.y)}}},{key:"pathC",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getPoint(),a=n.getAsControlPoint(),o=n.getAsCurrentPoint();n.addMarker(o,a,i),e.addBezierCurve(r.x,r.y,i.x,i.y,a.x,a.y,o.x,o.y),t&&t.bezierCurveTo(i.x,i.y,a.x,a.y,o.x,o.y)}}},{key:"pathS",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getReflectedControlPoint(),a=n.getAsControlPoint(),o=n.getAsCurrentPoint();n.addMarker(o,a,i),e.addBezierCurve(r.x,r.y,i.x,i.y,a.x,a.y,o.x,o.y),t&&t.bezierCurveTo(i.x,i.y,a.x,a.y,o.x,o.y)}}},{key:"pathQ",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getAsControlPoint(),a=n.getAsCurrentPoint();n.addMarker(a,i,i),e.addQuadraticCurve(r.x,r.y,i.x,i.y,a.x,a.y),t&&t.quadraticCurveTo(i.x,i.y,a.x,a.y)}}},{key:"pathT",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getReflectedControlPoint();n.control=i;var a=n.getAsCurrentPoint();n.addMarker(a,i,i),e.addQuadraticCurve(r.x,r.y,i.x,i.y,a.x,a.y),t&&t.quadraticCurveTo(i.x,i.y,a.x,a.y)}}},{key:"pathA",value:function(t,e){for(var n=this.pathParser;!n.isCommandOrEnd();){var r=n.current,i=n.getScalar(),a=n.getScalar(),o=n.getScalar()*(Math.PI/180),s=n.getScalar(),u=n.getScalar(),h=n.getAsCurrentPoint(),l=new Yt(Math.cos(o)*(r.x-h.x)/2+Math.sin(o)*(r.y-h.y)/2,-Math.sin(o)*(r.x-h.x)/2+Math.cos(o)*(r.y-h.y)/2),c=Math.pow(l.x,2)/Math.pow(i,2)+Math.pow(l.y,2)/Math.pow(a,2);c>1&&(i*=Math.sqrt(c),a*=Math.sqrt(c));var f=(s===u?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(l.y,2)-Math.pow(a,2)*Math.pow(l.x,2))/(Math.pow(i,2)*Math.pow(l.y,2)+Math.pow(a,2)*Math.pow(l.x,2)));isNaN(f)&&(f=0);var g=new Yt(f*i*l.y/a,f*-a*l.x/i),d=new Yt((r.x+h.x)/2+Math.cos(o)*g.x-Math.sin(o)*g.y,(r.y+h.y)/2+Math.sin(o)*g.x+Math.cos(o)*g.y),y=Ft([1,0],[(l.x-g.x)/i,(l.y-g.y)/a]),p=[(l.x-g.x)/i,(l.y-g.y)/a],v=[(-l.x-g.x)/i,(-l.y-g.y)/a],m=Ft(p,v);Rt(p,v)<=-1&&(m=Math.PI),Rt(p,v)>=1&&(m=0);var x=1-u?1:-1,b=y+x*(m/2),w=new Yt(d.x+i*Math.cos(b),d.y+a*Math.sin(b));if(n.addMarkerAngle(w,b-x*Math.PI/2),n.addMarkerAngle(h,b-x*Math.PI),e.addPoint(h.x,h.y),t&&!isNaN(y)&&!isNaN(m)){var k=i>a?i:a,S=i>a?1:i/a,P=i>a?a/i:1;t.translate(d.x,d.y),t.rotate(o),t.scale(S,P),t.arc(0,0,k,y,y+m,Boolean(1-u)),t.scale(1/S,1/P),t.rotate(-o),t.translate(-d.x,-d.y)}}}},{key:"pathZ",value:function(t,e){var n=this.pathParser;t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath(),n.current=n.start}}]),e}(ye),we=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="svg",t.root=!1,t}return H()(e,t),T()(e,[{key:"clearContext",value:function(t){rt()(X()(e.prototype),"clearContext",this).call(this,t),this.document.screen.viewPort.removeCurrent()}},{key:"setContext",value:function(t){var n=this.document,r=n.screen,i=n.window,a=t.canvas;if(r.setDefaults(t),a.style&&void 0!==t.font&&i&&void 0!==i.getComputedStyle){t.font=i.getComputedStyle(a).getPropertyValue("font");var o=new Wt(n,"fontSize",ae.parse(t.font).fontSize);o.hasValue()&&(n.rootEmSize=o.getPixels("y"),n.emSize=n.rootEmSize)}rt()(X()(e.prototype),"setContext",this).call(this,t),this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y"));var s=r.viewPort,u=s.width,h=s.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%");var l=this.getAttribute("refX"),c=this.getAttribute("refY"),f=this.getAttribute("viewBox"),g=f.hasValue()?kt(f.getString()):null,d=!this.root&&"visible"!==this.getAttribute("overflow").getValue("hidden"),y=0,p=0,v=0,m=0;g&&(y=g[0],p=g[1]),this.root||(u=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y"),"marker"===this.type&&(v=y,m=p,y=0,p=0)),r.viewPort.setCurrent(u,h),g&&(u=g[2],h=g[3]),n.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:r.viewPort.width,desiredWidth:u,height:r.viewPort.height,desiredHeight:h,minX:y,minY:p,refX:l.getValue(),refY:c.getValue(),clip:d,clipX:v,clipY:m}),g&&(r.viewPort.removeCurrent(),r.viewPort.setCurrent(u,h))}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),i=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),o=this.getAttribute("style"),s=r.getNumber(0),u=i.getNumber(0);if(n)if("string"==typeof n)this.getAttribute("preserveAspectRatio",!0).setValue(n);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(t),i.setValue(e),a.hasValue()||a.setValue("0 0 ".concat(s||t," ").concat(u||e)),o.hasValue()){var l=this.getStyle("width"),c=this.getStyle("height");l.hasValue()&&l.setValue("".concat(t,"px")),c.hasValue()&&c.setValue("".concat(e,"px"))}}}]),e}(ye),ke=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="rect",t}return H()(e,t),T()(e,[{key:"path",value:function(t){var e=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y"),a=this.getAttribute("rx"),o=this.getAttribute("ry"),s=a.getPixels("x"),u=o.getPixels("y");if(a.hasValue()&&!o.hasValue()&&(u=s),o.hasValue()&&!a.hasValue()&&(s=u),s=Math.min(s,r/2),u=Math.min(u,i/2),t){var h=(Math.sqrt(2)-1)/3*4;t.beginPath(),i>0&&r>0&&(t.moveTo(e+s,n),t.lineTo(e+r-s,n),t.bezierCurveTo(e+r-s+h*s,n,e+r,n+u-h*u,e+r,n+u),t.lineTo(e+r,n+i-u),t.bezierCurveTo(e+r,n+i-u+h*u,e+r-s+h*s,n+i,e+r-s,n+i),t.lineTo(e+s,n+i),t.bezierCurveTo(e+s-h*s,n+i,e,n+i-u+h*u,e,n+i-u),t.lineTo(e,n+u),t.bezierCurveTo(e,n+u-h*u,e+s-h*s,n,e+s,n),t.closePath())}return new oe(e,n,e+r,n+i)}},{key:"getMarkers",value:function(){return null}}]),e}(be),Se=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="circle",t}return H()(e,t),T()(e,[{key:"path",value:function(t){var e=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return t&&r>0&&(t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()),new oe(e-r,n-r,e+r,n+r)}},{key:"getMarkers",value:function(){return null}}]),e}(be),Pe=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="ellipse",t}return H()(e,t),T()(e,[{key:"path",value:function(t){var e=(Math.sqrt(2)-1)/3*4,n=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),a=this.getAttribute("cy").getPixels("y");return t&&(t.beginPath(),t.moveTo(i+n,a),t.bezierCurveTo(i+n,a+e*r,i+e*n,a+r,i,a+r),t.bezierCurveTo(i-e*n,a+r,i-n,a+e*r,i-n,a),t.bezierCurveTo(i-n,a-e*r,i-e*n,a-r,i,a-r),t.bezierCurveTo(i+e*n,a-r,i+n,a-e*r,i+n,a),t.closePath()),new oe(i-n,a-r,i+n,a+r)}},{key:"getMarkers",value:function(){return null}}]),e}(be),Ae=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="line",t}return H()(e,t),T()(e,[{key:"getPoints",value:function(){return[new Yt(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Yt(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(t){var e=this.getPoints(),n=l()(e,2),r=n[0],i=r.x,a=r.y,o=n[1],s=o.x,u=o.y;return t&&(t.beginPath(),t.moveTo(i,a),t.lineTo(s,u)),new oe(i,a,s,u)}},{key:"getMarkers",value:function(){var t=this.getPoints(),e=l()(t,2),n=e[0],r=e[1],i=n.angleTo(r);return[[n,i],[r,i]]}}]),e}(be),Ce=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="polyline",i.points=[],i.points=Yt.parsePath(i.getAttribute("points").getString()),i}return H()(e,t),T()(e,[{key:"path",value:function(t){var e=this.points,n=l()(e,1)[0],r=n.x,i=n.y,a=new oe(r,i);return t&&(t.beginPath(),t.moveTo(r,i)),e.forEach(function(e){var n=e.x,r=e.y;a.addPoint(n,r),t&&t.lineTo(n,r)}),a}},{key:"getMarkers",value:function(){var t=this.points,e=t.length-1,n=[];return t.forEach(function(r,i){i!==e&&n.push([r,r.angleTo(t[i+1])])}),n.length>0&&n.push([t[t.length-1],n[n.length-1][1]]),n}}]),e}(be),Ee=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="polygon",t}return H()(e,t),T()(e,[{key:"path",value:function(t){var n=rt()(X()(e.prototype),"path",this).call(this,t),r=l()(this.points,1)[0],i=r.x,a=r.y;return t&&(t.lineTo(i,a),t.closePath()),n}}]),e}(Ce),Me=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="pattern",t}return H()(e,t),T()(e,[{key:"createPattern",value:function(t,e,n){var r=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),a=new we(this.document,null);a.attributes.viewBox=new Wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.width=new Wt(this.document,"width","".concat(r,"px")),a.attributes.height=new Wt(this.document,"height","".concat(i,"px")),a.attributes.transform=new Wt(this.document,"transform",this.getAttribute("patternTransform").getValue()),a.children=this.children;var o=this.document.createCanvas(r,i),s=o.getContext("2d"),u=this.getAttribute("x"),h=this.getAttribute("y");u.hasValue()&&h.hasValue()&&s.translate(u.getPixels("x",!0),h.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(var l=-1;l<=1;l++)for(var c=-1;c<=1;c++)s.save(),a.attributes.x=new Wt(this.document,"x",l*o.width),a.attributes.y=new Wt(this.document,"y",c*o.height),a.render(s),s.restore();return t.createPattern(o,"repeat")}}]),e}(ne),Te=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="marker",t}return H()(e,t),T()(e,[{key:"render",value:function(t,e,n){if(e){var r=e.x,i=e.y,a=this.getAttribute("orient").getValue("auto"),o=this.getAttribute("markerUnits").getValue("strokeWidth");t.translate(r,i),"auto"===a&&t.rotate(n),"strokeWidth"===o&&t.scale(t.lineWidth,t.lineWidth),t.save();var s=new we(this.document,null);s.type=this.type,s.attributes.viewBox=new Wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.refX=new Wt(this.document,"refX",this.getAttribute("refX").getValue()),s.attributes.refY=new Wt(this.document,"refY",this.getAttribute("refY").getValue()),s.attributes.width=new Wt(this.document,"width",this.getAttribute("markerWidth").getValue()),s.attributes.height=new Wt(this.document,"height",this.getAttribute("markerHeight").getValue()),s.attributes.overflow=new Wt(this.document,"overflow",this.getAttribute("overflow").getValue()),s.attributes.fill=new Wt(this.document,"fill",this.getAttribute("fill").getValue("black")),s.attributes.stroke=new Wt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),s.children=this.children,s.render(t),t.restore(),"strokeWidth"===o&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===a&&t.rotate(-n),t.translate(-r,-i)}}}]),e}(ne),Ve=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="defs",t}return H()(e,t),T()(e,[{key:"render",value:function(){}}]),e}(ne),Le=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="g",t}return H()(e,t),T()(e,[{key:"getBoundingBox",value:function(t){var e=new oe;return this.children.forEach(function(n){e.addBoundingBox(n.getBoundingBox(t))}),e}}]),e}(ye),Oe=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).attributesToInherit=["gradientUnits"],i.stops=[];var a=ht()(i),o=a.stops;return a.children.forEach(function(t){"stop"===t.type&&o.push(t)}),i}return H()(e,t),T()(e,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(t,e,n){var r=this,i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var a=i.stops,o=this.getGradient(t,e);if(!o)return this.addParentOpacity(n,a[a.length-1].color);if(a.forEach(function(t){o.addColorStop(t.offset,r.addParentOpacity(n,t.color))}),this.getAttribute("gradientTransform").hasValue()){var s=this.document,u=s.screen,h=u.MAX_VIRTUAL_PIXELS,c=u.viewPort,f=l()(c.viewPorts,1)[0],g=new ke(s,null);g.attributes.x=new Wt(s,"x",-h/3),g.attributes.y=new Wt(s,"y",-h/3),g.attributes.width=new Wt(s,"width",h),g.attributes.height=new Wt(s,"height",h);var d=new Le(s,null);d.attributes.transform=new Wt(s,"transform",this.getAttribute("gradientTransform").getValue()),d.children=[g];var y=new we(s,null);y.attributes.x=new Wt(s,"x",0),y.attributes.y=new Wt(s,"y",0),y.attributes.width=new Wt(s,"width",f.width),y.attributes.height=new Wt(s,"height",f.height),y.children=[d];var p=s.createCanvas(f.width,f.height),v=p.getContext("2d");return v.fillStyle=o,y.render(v),v.createPattern(p,"no-repeat")}return o}},{key:"inheritStopContainer",value:function(t){var e=this;this.attributesToInherit.forEach(function(n){!e.getAttribute(n).hasValue()&&t.getAttribute(n).hasValue()&&e.getAttribute(n,!0).setValue(t.getAttribute(n).getValue())})}},{key:"addParentOpacity",value:function(t,e){return t.hasValue()?new Wt(this.document,"color",e).addOpacity(t).getString():e}}]),e}(ne),Ne=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="linearGradient",i.attributesToInherit.push("x1","y1","x2","y2"),i}return H()(e,t),T()(e,[{key:"getGradient",value:function(t,e){var n="objectBoundingBox"===this.getGradientUnits(),r=n?e.getBoundingBox(t):null;if(n&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=n?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),a=n?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),o=n?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),s=n?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===o&&a===s?null:t.createLinearGradient(i,a,o,s)}}]),e}(Oe),ze=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="radialGradient",i.attributesToInherit.push("cx","cy","r","fx","fy","fr"),i}return H()(e,t),T()(e,[{key:"getGradient",value:function(t,e){var n="objectBoundingBox"===this.getGradientUnits(),r=e.getBoundingBox(t);if(n&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=n?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),a=n?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),o=i,s=a;this.getAttribute("fx").hasValue()&&(o=n?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(s=n?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=n?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return t.createRadialGradient(o,s,h,i,a,u)}}]),e}(Oe),Be=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="stop";var a=Math.max(0,Math.min(1,i.getAttribute("offset").getNumber())),o=i.getStyle("stop-opacity"),s=i.getStyle("stop-color",!0);return""===s.getString()&&s.setValue("#000"),o.hasValue()&&(s=s.addOpacity(o)),i.offset=a,i.color=s.getString(),i}return H()(e,t),e}(ne),De=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="animate",i.duration=0,i.initialValue=null,i.initialUnits="",i.removed=!1,i.frozen=!1,t.screen.animations.push(ht()(i)),i.begin=i.getAttribute("begin").getMilliseconds(),i.maxDuration=i.begin+i.getAttribute("dur").getMilliseconds(),i.from=i.getAttribute("from"),i.to=i.getAttribute("to"),i.values=i.getAttribute("values"),i.values.hasValue()&&i.values.setValue(i.values.getString().split(";")),i}return H()(e,t),T()(e,[{key:"getProperty",value:function(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}},{key:"calcValue",value:function(){var t=this.initialUnits,e=this.getProgress(),n=e.progress,r=e.from,i=e.to,a=r.getNumber()+(i.getNumber()-r.getNumber())*n;return"%"===t&&(a*=100),"".concat(a).concat(t)}},{key:"update",value:function(t){var e=this.parent,n=this.getProperty();if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,n.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=n.getString();return!1}this.duration+=t;var i=!1;if(this.begin<this.duration){var a=this.calcValue(),o=this.getAttribute("type");if(o.hasValue()){var s=o.getString();a="".concat(s,"(").concat(a,")")}n.setValue(a),i=!0}return i}},{key:"getProgress",value:function(){var t=this.document,e=this.values,n={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(e.hasValue()){var r=n.progress*(e.getValue().length-1),i=Math.floor(r),a=Math.ceil(r);n.from=new Wt(t,"from",parseFloat(e.getValue()[i])),n.to=new Wt(t,"to",parseFloat(e.getValue()[a])),n.progress=(r-i)/(a-i)}else n.from=this.from,n.to=this.to;return n}}]),e}(ne),Re=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="animateColor",t}return H()(e,t),T()(e,[{key:"calcValue",value:function(){var t=this.getProgress(),e=t.progress,n=t.from,r=t.to,i=new q.a(n.getString()),a=new q.a(r.getString());if(i.ok&&a.ok){var o=i.r+(a.r-i.r)*e,s=i.g+(a.g-i.g)*e,u=i.b+(a.b-i.b)*e;return"rgb(".concat(parseInt(o,10),", ").concat(parseInt(s,10),", ").concat(parseInt(u,10),")")}return this.getAttribute("from").getString()}}]),e}(De),Fe=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="animateTransform",t}return H()(e,t),T()(e,[{key:"calcValue",value:function(){var t=this.getProgress(),e=t.progress,n=t.from,r=t.to,i=kt(n.getString()),a=kt(r.getString());return i.map(function(t,n){return t+(a[n]-t)*e}).join(" ")}}]),e}(De),Ie=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="font",i.glyphs={},i.horizAdvX=i.getAttribute("horiz-adv-x").getNumber();var a=t.definitions,o=ht()(i).children,s=!0,u=!1,h=void 0;try{for(var l,c=o[Symbol.iterator]();!(s=(l=c.next()).done);s=!0){var f=l.value;switch(f.type){case"font-face":i.fontFace=f;var g=f.getStyle("font-family");g.hasValue()&&(a[g.getString()]=ht()(i));break;case"missing-glyph":i.missingGlyph=f;break;case"glyph":var d=f;d.arabicForm?(i.isRTL=!0,i.isArabic=!0,void 0===i.glyphs[d.unicode]&&(i.glyphs[d.unicode]={}),i.glyphs[d.unicode][d.arabicForm]=d):i.glyphs[d.unicode]=d}}}catch(t){u=!0,h=t}finally{try{s||null==c.return||c.return()}finally{if(u)throw h}}return i}return H()(e,t),T()(e,[{key:"render",value:function(){}}]),e}(ne),je=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="font-face",i.ascent=i.getAttribute("ascent").getNumber(),i.descent=i.getAttribute("descent").getNumber(),i.unitsPerEm=i.getAttribute("units-per-em").getNumber(),i}return H()(e,t),e}(ne),qe=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="missing-glyph",t.horizAdvX=0,t}return H()(e,t),e}(be),Ge=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="glyph",i.horizAdvX=i.getAttribute("horiz-adv-x").getNumber(),i.unicode=i.getAttribute("unicode").getString(),i.arabicForm=i.getAttribute("arabic-form").getString(),i}return H()(e,t),e}(be),_e=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="tref",t}return H()(e,t),T()(e,[{key:"getText",value:function(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}]),e}(pe),$e=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="a";var a=n.childNodes,o=a[0],s=a.length>0&&Array.from(a).every(function(t){return 3===t.nodeType});return i.hasText=s,i.text=s?i.getTextFromNode(o):"",i}return H()(e,t),T()(e,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(t){if(this.hasText){rt()(X()(e.prototype),"renderChildren",this).call(this,t);var n=this.document,r=this.x,i=this.y,a=n.screen.mouse,o=new Wt(n,"fontSize",ae.parse(n.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new oe(r,i-o.getPixels("y"),r+this.measureText(t),i))}else if(this.children.length>0){var s=new Le(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}},{key:"onClick",value:function(){var t=this.document.window;t&&t.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),e}(pe),Xe=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="textPath",i.textWidth=0,i.textHeight=0,i.pathLength=-1,i.glyphInfo=null,i.letterSpacingCache=[],i.measuresCache=new Map([["",0]]);var a=i.getHrefAttribute().getDefinition();return i.text=i.getTextFromNode(),i.dataArray=i.parsePathData(a),i}return H()(e,t),T()(e,[{key:"getText",value:function(){return this.text}},{key:"path",value:function(t){var e=this.dataArray;t&&t.beginPath(),e.forEach(function(e){var n=e.command,r=e.points;switch(n){case"L":t&&t.lineTo(r[0],r[1]);break;case"M":t&&t.moveTo(r[0],r[1]);break;case"C":t&&t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case"Q":t&&t.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case"A":var i=r[0],a=r[1],o=r[2],s=r[3],u=r[4],h=r[5],l=r[6],c=r[7],f=o>s?o:s,g=o>s?1:o/s,d=o>s?s/o:1;t&&(t.translate(i,a),t.rotate(l),t.scale(g,d),t.arc(0,0,f,u,u+h,Boolean(1-c)),t.scale(1/g,1/d),t.rotate(-l),t.translate(-i,-a));break;case"z":t&&t.closePath()}})}},{key:"renderChildren",value:function(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),r=this.glyphInfo,i=t.fillStyle;"underline"===e&&t.beginPath(),r.forEach(function(i,a){var o=i.p0,s=i.p1,u=i.text;t.save(),t.translate(o.x,o.y),t.rotate(r[a].rotation),t.fillStyle&&t.fillText(u,0,0),t.strokeStyle&&t.strokeText(u,0,0),t.restore(),"underline"===e&&(0===a&&t.moveTo(o.x,o.y+n/8),t.lineTo(s.x,s.y+n/5))}),"underline"===e&&(t.lineWidth=n/20,t.strokeStyle=i,t.stroke(),t.closePath()),t.restore()}},{key:"getLetterSpacingAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}},{key:"findSegmentToFitChar",value:function(t,e,n,r,i,a,o,s){var u=a,h=this.measureText(t,o);" "===o&&"justify"===e&&n<r&&(h+=(r-n)/i),s>-1&&(u+=this.getLetterSpacingAt(s));var l=this.textHeight/20,c={p0:this.getEquidistantPointOnPath(u,l),p1:this.getEquidistantPointOnPath(u+h,l)};return{offset:u+=h,segment:c}}},{key:"measureText",value:function(t,e){var n=this.measuresCache,r=e||this.getText();if(n.has(r))return n.get(r);var i=this.measureTargetText(t,r);return n.set(r,i),i}},{key:"setTextData",value:function(t){var e=this;if(!this.glyphInfo){var n=this.getText(),r=n.split(""),i=n.split(" ").length-1,a=kt(this.parent.getAttribute("dx").getString("0")),o=this.parent.getStyle("text-anchor").getString("start"),s=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing"),h=0;s.hasValue()&&"inherit"!==s.getValue()?s.hasValue()&&"initial"!==s.getValue()&&"unset"!==s.getValue()&&(h=s.getPixels()):h=u.getPixels();var l=[],c=n.length;this.letterSpacingCache=l;for(var f=0;f<c;f++)l.push(void 0!==a[f]?a[f]:h);var g=l.reduce(function(t,e){return t+e||0},0);this.textWidth=this.measureText(t),this.textHeight=this.getFontSize();var d=Math.max(this.textWidth+g,0);this.glyphInfo=[];var y=this.getPathLength(),p=this.getStyle("startOffset").getNumber(0)*y,v=0;"middle"!==o&&"center"!==o||(v=-d/2),"end"!==o&&"right"!==o||(v=-d),v+=p,r.forEach(function(n,a){var s=e.findSegmentToFitChar(t,o,d,y,i,v,n,a),u=s.offset,h=s.segment;if(v=u,h.p0&&h.p1){var l=e.getLineLength(h.p0.x,h.p0.y,h.p1.x,h.p1.y),c=e.getPointOnLine(0+l/2,h.p0.x,h.p0.y,h.p1.x,h.p1.y),f=Math.atan2(h.p1.y-h.p0.y,h.p1.x-h.p0.x);e.glyphInfo.push({transposeX:c.x,transposeY:c.y,text:r[a],p0:h.p0,p1:h.p1,rotation:f})}})}}},{key:"parsePathData",value:function(t){if(this.pathLength=-1,!t)return[];var e=[],n=t.pathParser;for(n.reset();!n.isEnd();){var r=n.current,i=r?r.x:0,a=r?r.y:0,o="",s=[];n.nextCommand();var u=n.command.toUpperCase();switch(n.command){case"M":case"m":o=this.pathM(n,s);break;case"L":case"l":o=this.pathL(n,s);break;case"H":case"h":o=this.pathH(n,s);break;case"V":case"v":o=this.pathV(n,s);break;case"C":case"c":this.pathC(n,s);break;case"S":case"s":o=this.pathS(n,s);break;case"Q":case"q":this.pathQ(n,s);break;case"T":case"t":o=this.pathT(n,s);break;case"A":case"a":s=this.pathA(n);break;case"Z":case"z":n.current=n.start}"Z"!==u?e.push({command:o||u,points:s,start:{x:i,y:a},pathLength:this.calcLength(i,a,o||u,s)}):e.push({command:"z",points:[],pathLength:0})}return e}},{key:"pathM",value:function(t,e){var n=t.getAsCurrentPoint();for(e.push(n.x,n.y),t.start=t.current;!t.isCommandOrEnd();){var r=t.getAsCurrentPoint();return e.push(r.x,r.y),"L"}}},{key:"pathL",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.getAsCurrentPoint();e.push(n.x,n.y)}return"L"}},{key:"pathH",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.current,r=new Yt((t.isRelativeCommand()?n.x:0)+t.getScalar(),n.y);e.push(r.x,r.y),t.current=r}return"L"}},{key:"pathV",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.current,r=new Yt(n.x,(t.isRelativeCommand()?n.y:0)+t.getScalar());e.push(r.x,r.y),t.current=r}return"L"}},{key:"pathC",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.getPoint(),r=t.getAsControlPoint(),i=t.getAsCurrentPoint();e.push(n.x,n.y,r.x,r.y,i.x,i.y)}}},{key:"pathS",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.getReflectedControlPoint(),r=t.getAsControlPoint(),i=t.getAsCurrentPoint();e.push(n.x,n.y,r.x,r.y,i.x,i.y)}return"C"}},{key:"pathQ",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.getAsControlPoint(),r=t.getAsCurrentPoint();e.push(n.x,n.y,r.x,r.y)}}},{key:"pathT",value:function(t,e){for(;!t.isCommandOrEnd();){var n=t.getReflectedControlPoint();t.control=n;var r=t.getAsCurrentPoint();e.push(n.x,n.y,r.x,r.y)}return"Q"}},{key:"pathA",value:function(t){for(;!t.isCommandOrEnd();){var e=t.current,n=t.getScalar(),r=t.getScalar(),i=t.getScalar()*(Math.PI/180),a=t.getScalar(),o=t.getScalar(),s=t.getAsCurrentPoint(),u=new Yt(Math.cos(i)*(e.x-s.x)/2+Math.sin(i)*(e.y-s.y)/2,-Math.sin(i)*(e.x-s.x)/2+Math.cos(i)*(e.y-s.y)/2),h=Math.pow(u.x,2)/Math.pow(n,2)+Math.pow(u.y,2)/Math.pow(r,2);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var l=(a===o?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(r,2)-Math.pow(n,2)*Math.pow(u.y,2)-Math.pow(r,2)*Math.pow(u.x,2))/(Math.pow(n,2)*Math.pow(u.y,2)+Math.pow(r,2)*Math.pow(u.x,2)));isNaN(l)&&(l=0);var c=new Yt(l*n*u.y/r,l*-r*u.x/n),f=new Yt((e.x+s.x)/2+Math.cos(i)*c.x-Math.sin(i)*c.y,(e.y+s.y)/2+Math.sin(i)*c.x+Math.cos(i)*c.y),g=Ft([1,0],[(u.x-c.x)/n,(u.y-c.y)/r]),d=[(u.x-c.x)/n,(u.y-c.y)/r],y=[(-u.x-c.x)/n,(-u.y-c.y)/r],p=Ft(d,y);return Rt(d,y)<=-1&&(p=Math.PI),Rt(d,y)>=1&&(p=0),0===o&&p>0&&(p-=2*Math.PI),1===o&&p<0&&(p+=2*Math.PI),[f.x,f.y,n,r,g,p,i,o]}}},{key:"calcLength",value:function(t,e,n,r){var i=0,a=null,o=null,s=0;switch(n){case"L":return this.getLineLength(t,e,r[0],r[1]);case"C":for(i=0,a=this.getPointOnCubicBezier(0,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)o=this.getPointOnCubicBezier(s,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;return i;case"Q":for(i=0,a=this.getPointOnQuadraticBezier(0,t,e,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)o=this.getPointOnQuadraticBezier(s,t,e,r[0],r[1],r[2],r[3]),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;return i;case"A":i=0;var u=r[4],h=r[5],l=r[4]+h,c=Math.PI/180;if(Math.abs(u-l)<c&&(c=Math.abs(u-l)),a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],u,0),h<0)for(s=u-c;s>l;s-=c)o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(s=u+c;s<l;s+=c)o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;return o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),i+=this.getLineLength(a.x,a.y,o.x,o.y)}return 0}},{key:"getPointOnLine",value:function(t,e,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n,s=(i-n)/(r-e+Bt),u=Math.sqrt(t*t/(1+s*s));r<e&&(u*=-1);var h=s*u,l=null;if(r===e)l={x:a,y:o+h};else if((o-n)/(a-e+Bt)===s)l={x:a+u,y:o+h};else{var c,f,g=this.getLineLength(e,n,r,i);if(g<Bt)return null;var d=(a-e)*(r-e)+(o-n)*(i-n);c=e+(d/=g*g)*(r-e),f=n+d*(i-n);var y=this.getLineLength(a,o,c,f),p=Math.sqrt(t*t-y*y);u=Math.sqrt(p*p/(1+s*s)),r<e&&(u*=-1),l={x:c+u,y:f+(h=s*u)}}return l}},{key:"getPointOnPath",value:function(t){var e=this.getPathLength(),n=0,r=null;if(t<-5e-5||t-5e-5>e)return null;var i=this.dataArray,a=!0,o=!1,s=void 0;try{for(var u,h=i[Symbol.iterator]();!(a=(u=h.next()).done);a=!0){var l=u.value;if(!l||!(l.pathLength<5e-5||n+l.pathLength+5e-5<t)){var c=t-n,f=0;switch(l.command){case"L":r=this.getPointOnLine(c,l.start.x,l.start.y,l.points[0],l.points[1],l.start.x,l.start.y);break;case"A":var g=l.points[4],d=l.points[5],y=l.points[4]+d;if(f=g+c/l.pathLength*d,d<0&&f<y||d>=0&&f>y)break;r=this.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],f,l.points[6]);break;case"C":(f=c/l.pathLength)>1&&(f=1),r=this.getPointOnCubicBezier(f,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);break;case"Q":(f=c/l.pathLength)>1&&(f=1),r=this.getPointOnQuadraticBezier(f,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3])}if(r)return r;break}n+=l.pathLength}}catch(t){o=!0,s=t}finally{try{a||null==h.return||h.return()}finally{if(o)throw s}}return null}},{key:"getLineLength",value:function(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce(function(t,e){return e.pathLength>0?t+e.pathLength:t},0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(t,e,n,r,i,a,o,s,u){return{x:s*It(t)+a*jt(t)+r*qt(t)+e*Gt(t),y:u*It(t)+o*jt(t)+i*qt(t)+n*Gt(t)}}},{key:"getPointOnQuadraticBezier",value:function(t,e,n,r,i,a,o){return{x:a*_t(t)+r*$t(t)+e*Xt(t),y:o*_t(t)+i*$t(t)+n*Xt(t)}}},{key:"getPointOnEllipticalArc",value:function(t,e,n,r,i,a){var o=Math.cos(a),s=Math.sin(a),u=n*Math.cos(i),h=r*Math.sin(i);return{x:t+(u*o-h*s),y:e+(u*s+h*o)}}},{key:"buildEquidistantCache",value:function(t,e){var n=this.getPathLength(),r=e||.25,i=t||n/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==r){this.equidistantCache={step:i,precision:r,points:[]};for(var a=0,o=0;o<=n;o+=r){var s=this.getPointOnPath(o),u=this.getPointOnPath(o+r);s&&u&&((a+=this.getLineLength(s.x,s.y,u.x,u.y))>=i&&(this.equidistantCache.points.push({x:s.x,y:s.y,distance:o}),a-=i))}}}},{key:"getEquidistantPointOnPath",value:function(t,e,n){if(this.buildEquidistantCache(e,n),t<0||t-this.getPathLength()>5e-5)return null;var r=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}]),e}(pe),We=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="image",i.loaded=!1;var a=i.getHrefAttribute().getString();if(!a)return _()(i);var o=/\.svg$/.test(a);return t.images.push(ht()(i)),o?i.loadSvg(a):i.loadImage(a),i.isSvg=o,i}return H()(e,t),T()(e,[{key:"loadImage",value:function(){var t=S()(w.a.mark(function t(e){var n;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.document.createImage(e);case 3:n=t.sent,this.image=n,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.error('ERROR: image "'.concat(e,'" not found'),t.t0);case 10:this.loaded=!0;case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"loadSvg",value:function(){var t=S()(w.a.mark(function t(e){var n,r;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.document.fetch(e);case 3:return n=t.sent,t.next=6,n.text();case 6:r=t.sent,this.image=r,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.error('ERROR: image "'.concat(e,'" not found'),t.t0);case 13:this.loaded=!0;case 14:case"end":return t.stop()}},t,this,[[0,10]])}));return function(e){return t.apply(this,arguments)}}()},{key:"renderChildren",value:function(t){var e=this.document,n=this.image,r=this.loaded,i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(r&&n&&o&&s){if(t.save(),this.isSvg)e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:i,offsetY:a,scaleWidth:o,scaleHeight:s}).render();else{var u=this.image;t.translate(i,a),e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:o,desiredWidth:u.width,height:s,desiredHeight:u.height}),this.loaded&&(void 0===u.complete||u.complete)&&t.drawImage(u,0,0)}t.restore()}}},{key:"getBoundingBox",value:function(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new oe(t,e,t+n,e+r)}}]),e}(ye),He=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="symbol",t}return H()(e,t),T()(e,[{key:"render",value:function(t){}}]),e}(ye),Ye=function(){function t(e){E()(this,t),this.document=e,this.loaded=!1,e.fonts.push(this)}return T()(t,[{key:"load",value:function(){var t=S()(w.a.mark(function t(e,n){var r,i,a;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=this.document,t.next=4,r.canvg.parser.load(n);case 4:i=t.sent,a=i.getElementsByTagName("font"),Array.from(a).forEach(function(t){var n=r.createElement(t);r.definitions[e]=n}),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),console.error('ERROR: font "'.concat(n,'" not found'),t.t0);case 12:this.loaded=!0;case 13:case"end":return t.stop()}},t,this,[[0,9]])}));return function(e,n){return t.apply(this,arguments)}}()}]),t}(),Ue=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="style",xt(Array.from(n.childNodes).map(function(t){return t.data}).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"")).split("}").forEach(function(e){var n=e.trim();if(n){var r=n.split("{"),i=r[0].split(","),a=r[1].split(";");i.forEach(function(e){var n=e.trim();if(n){var r=t.styles[n]||{};if(a.forEach(function(e){var n=e.indexOf(":"),i=e.substr(0,n).trim(),a=e.substr(n+1,e.length-n).trim();i&&a&&(r[i]=new Wt(t,i,a))}),t.styles[n]=r,t.stylesSpecificity[n]=zt(n),"@font-face"===n){var i=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach(function(e){if(e.indexOf('format("svg")')>0){var n=At(e);n&&new Ye(t).load(i,n)}})}}})}}),i}return H()(e,t),e}(ne);Ue.parseExternalUrl=At;var Qe=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="use",t}return H()(e,t),T()(e,[{key:"setContext",value:function(t){rt()(X()(e.prototype),"setContext",this).call(this,t);var n=this.getAttribute("x"),r=this.getAttribute("y");n.hasValue()&&t.translate(n.getPixels("x"),0),r.hasValue()&&t.translate(0,r.getPixels("y"))}},{key:"path",value:function(t){var e=this.element;e&&e.path(t)}},{key:"renderChildren",value:function(t){var e=this.document,n=this.element;if(n){var r=n;if("symbol"===n.type&&((r=new we(e,null)).attributes.viewBox=new Wt(e,"viewBox",n.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new Wt(e,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new Wt(e,"overflow",n.getAttribute("overflow").getString()),r.children=n.children),"svg"===r.type){var i=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);i.hasValue()&&(r.attributes.width=new Wt(e,"width",i.getString())),a.hasValue()&&(r.attributes.height=new Wt(e,"height",a.getString()))}var o=r.parent;r.parent=null,r.render(t),r.parent=o}}},{key:"getBoundingBox",value:function(t){var e=this.element;return e?e.getBoundingBox(t):null}},{key:"elementTransform",value:function(){var t=this.document,e=this.element;return de.fromElement(t,e)}},{key:"element",get:function(){return this._element||(this._element=this.getHrefAttribute().getDefinition()),this._element}}]),e}(ye);function Ze(t,e,n,r,i,a){return t[n*r*4+4*e+a]}function Ke(t,e,n,r,i,a,o){t[n*r*4+4*e+a]=o}function Je(t,e,n){var r=t[e];return r*(r<0?n-255:n)}function tn(t,e,n,r){return e+Math.cos(t)*n+Math.sin(t)*r}var en=function(t){function e(t,n,r){var i;E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="feColorMatrix";var a=kt(i.getAttribute("values").getString());switch(i.getAttribute("type").getString("matrix")){case"saturate":var o=a[0];a=[.213+.787*o,.715-.715*o,.072-.072*o,0,0,.213-.213*o,.715+.285*o,.072-.072*o,0,0,.213-.213*o,.715-.715*o,.072+.928*o,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var s=a[0]*Math.PI/180;a=[tn(s,.213,.787,-.213),tn(s,.715,-.715,-.715),tn(s,.072,-.072,.928),0,0,tn(s,.213,-.213,.143),tn(s,.715,.285,.14),tn(s,.072,-.072,-.283),0,0,tn(s,.213,-.213,-.787),tn(s,.715,-.715,.715),tn(s,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return i.matrix=a,i.includeOpacity=i.getAttribute("includeOpacity").hasValue(),i}return H()(e,t),T()(e,[{key:"apply",value:function(t,e,n,r,i){for(var a=this.includeOpacity,o=this.matrix,s=t.getImageData(0,0,r,i),u=0;u<i;u++)for(var h=0;h<r;h++){var l=Ze(s.data,h,u,r,0,0),c=Ze(s.data,h,u,r,0,1),f=Ze(s.data,h,u,r,0,2),g=Ze(s.data,h,u,r,0,3),d=Je(o,0,l)+Je(o,1,c)+Je(o,2,f)+Je(o,3,g)+Je(o,4,1),y=Je(o,5,l)+Je(o,6,c)+Je(o,7,f)+Je(o,8,g)+Je(o,9,1),p=Je(o,10,l)+Je(o,11,c)+Je(o,12,f)+Je(o,13,g)+Je(o,14,1),v=Je(o,15,l)+Je(o,16,c)+Je(o,17,f)+Je(o,18,g)+Je(o,19,1);a&&(d=y=p=0,v*=g/255),Ke(s.data,h,u,r,0,0,d),Ke(s.data,h,u,r,0,1,y),Ke(s.data,h,u,r,0,2,p),Ke(s.data,h,u,r,0,3,v)}t.clearRect(0,0,r,i),t.putImageData(s,0,0)}}]),e}(ne),nn=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="mask",t}return H()(e,t),T()(e,[{key:"apply",value:function(t,e){var n=this.document,r=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!a&&!o){var s=new oe;this.children.forEach(function(e){s.addBoundingBox(e.getBoundingBox(t))}),r=Math.floor(s.x1),i=Math.floor(s.y1),a=Math.floor(s.width),o=Math.floor(s.height)}var u=e.getStyle("mask").getString();e.getStyle("mask").setValue("");var h=n.createCanvas(r+a,i+o),l=h.getContext("2d");n.screen.setDefaults(l),this.renderChildren(l),new en(n,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(l,0,0,r+a,i+o);var c=n.createCanvas(r+a,i+o),f=c.getContext("2d");n.screen.setDefaults(f),e.render(f),f.globalCompositeOperation="destination-in",f.fillStyle=l.createPattern(h,"no-repeat"),f.fillRect(0,0,r+a,i+o),t.fillStyle=f.createPattern(c,"no-repeat"),t.fillRect(0,0,r+a,i+o),e.getStyle("mask").setValue(u)}},{key:"render",value:function(t){}}]),e}(ne),rn=function(){},an=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="clipPath",t}return H()(e,t),T()(e,[{key:"apply",value:function(t){var e=this.document,n=Reflect.getPrototypeOf(t),r=t.beginPath,i=t.closePath;n&&(n.beginPath=rn,n.closePath=rn),Reflect.apply(r,t,[]),this.children.forEach(function(r){if(void 0!==r.path){var a=void 0!==r.elementTransform?r.elementTransform():null;a||(a=de.fromElement(e,r)),a&&a.apply(t),r.path(t),n&&(n.closePath=i),a&&a.unapply(t)}}),Reflect.apply(i,t,[]),t.clip(),n&&(n.beginPath=r,n.closePath=i)}},{key:"render",value:function(t){}}]),e}(ne),on=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="filter",t}return H()(e,t),T()(e,[{key:"apply",value:function(t,e){var n=this.document,r=e.getBoundingBox(t);if(r){var i=Math.floor(r.x1),a=Math.floor(r.y1),o=Math.floor(r.width),s=Math.floor(r.height),u=e.getStyle("filter").getString();e.getStyle("filter").setValue("");var h=0,l=0;this.children.forEach(function(t){var e=t.extraFilterDistance||0;h=Math.max(h,e),l=Math.max(l,e)});var c=n.createCanvas(o+2*h,s+2*l),f=c.getContext("2d");n.screen.setDefaults(f),f.translate(-i+h,-a+l),e.render(f),this.children.forEach(function(t){"function"==typeof t.apply&&t.apply(f,0,0,o+2*h,s+2*l)}),t.drawImage(c,0,0,o+2*h,s+2*l,i-h,a-l,o+2*h,s+2*l),e.getStyle("filter",!0).setValue(u)}}},{key:"render",value:function(t){}}]),e}(ne),sn=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="feDropShadow",i.addStylesFromStyleDefinition(),i}return H()(e,t),T()(e,[{key:"apply",value:function(t,e,n,r,i){}}]),e}(ne),un=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="feMorphology",t}return H()(e,t),T()(e,[{key:"apply",value:function(t,e,n,r,i){}}]),e}(ne),hn=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="feComposite",t}return H()(e,t),T()(e,[{key:"apply",value:function(t,e,n,r,i){}}]),e}(ne),ln=function(t){function e(t,n,r){var i;return E()(this,e),(i=_()(this,X()(e).call(this,t,n,r))).type="feGaussianBlur",i.blurRadius=Math.floor(i.getAttribute("stdDeviation").getNumber()),i.extraFilterDistance=i.blurRadius,i}return H()(e,t),T()(e,[{key:"apply",value:function(t,e,n,r,i){var a=this.document,o=this.blurRadius,s=a.window?a.window.document.body:null,u=t.canvas;u.id=a.getUniqueId(),s&&(u.style.display="none",s.appendChild(u)),Object(mt.a)(u,e,n,r,i,o),s&&s.removeChild(u)}}]),e}(ne),cn=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="title",t}return H()(e,t),e}(ne),fn=function(t){function e(){var t;return E()(this,e),(t=_()(this,X()(e).apply(this,arguments))).type="desc",t}return H()(e,t),e}(ne),gn={svg:we,rect:ke,circle:Se,ellipse:Pe,line:Ae,polyline:Ce,polygon:Ee,path:be,pattern:Me,marker:Te,defs:Ve,linearGradient:Ne,radialGradient:ze,stop:Be,animate:De,animateColor:Re,animateTransform:Fe,font:Ie,"font-face":je,"missing-glyph":qe,glyph:Ge,text:pe,tspan:ve,tref:_e,a:$e,textPath:Xe,image:We,g:Le,symbol:He,style:Ue,use:Qe,mask:nn,clipPath:an,filter:on,feDropShadow:sn,feMorphology:un,feComposite:hn,feColorMatrix:en,feGaussianBlur:ln,title:cn,desc:fn};function dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function yn(){return(yn=S()(w.a.mark(function t(e){var n,r,i=arguments;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]&&i[1],r=document.createElement("img"),n&&(r.crossOrigin="Anonymous"),t.abrupt("return",new Promise(function(t,n){r.onload=function(){t(r)},r.onerror=function(){n()},r.src=e}));case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}var pn=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.rootEmSize,i=void 0===r?12:r,a=n.emSize,o=void 0===a?12:a,s=n.createCanvas,u=void 0===s?t.createCanvas:s,h=n.createImage,l=void 0===h?t.createImage:h,c=n.anonymousCrossOrigin;E()(this,t),this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=i,this.emSize=o,this.createCanvas=u,this.createImage=this.bindCreateImage(l,c),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return T()(t,[{key:"bindCreateImage",value:function(t,e){return"boolean"==typeof e?function(n,r){return t(n,"boolean"==typeof r?r:e)}:t}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every(function(t){return t.loaded})}},{key:"isFontsLoaded",value:function(){return this.fonts.every(function(t){return t.loaded})}},{key:"createDocumentElement",value:function(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}},{key:"createElement",value:function(e){var n=e.nodeName.replace(/^[^:]+:/,""),r=t.elementTypes[n];return void 0!==r?new r(this,e):new re(this,e)}},{key:"createTextNode",value:function(t){return new me(this,t)}},{key:"setViewBox",value:function(t){this.screen.setViewBox(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dn(Object(n),!0).forEach(function(e){A()(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({document:this},t))}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var t=this.emSizeStack;return t[t.length-1]},set:function(t){this.emSizeStack.push(t)}}]),t}();function vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function mn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(n),!0).forEach(function(e){A()(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}pn.createCanvas=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,n},pn.createImage=function(t){return yn.apply(this,arguments)},pn.elementTypes=gn;var xn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};E()(this,t),this.parser=new ee(r),this.screen=new Kt(e,r),this.options=r;var i=new pn(this,r),a=i.createDocumentElement(n);this.document=i,this.documentElement=a}return T()(t,[{key:"fork",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.from(e,n,mn({},this.options,{},r))}},{key:"forkString",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fromString(e,n,mn({},this.options,{},r))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:function(){var t=S()(w.a.mark(function t(){var e,n=arguments;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},this.start(mn({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},e)),t.next=4,this.ready();case 4:this.stop();case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.documentElement,n=this.screen,r=this.options;n.start(e,mn({enableRedraw:!0},r,{},t))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,n)}}],[{key:"from",value:function(){var e=S()(w.a.mark(function e(n,r){var i,a,o,s=arguments;return w.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>2&&void 0!==s[2]?s[2]:{},a=new ee(i),e.next=4,a.parse(r);case 4:return o=e.sent,e.abrupt("return",new t(n,o,i));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"fromString",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new t(e,new ee(r).parseFromString(n),r)}}]),t}();var bn=Object.freeze({__proto__:null,offscreen:function(){return{window:null,ignoreAnimation:!0,ignoreMouse:!0,createCanvas:function(t,e){return new OffscreenCanvas(t,e)},createImage:function(){var t=S()(w.a.mark(function t(e){var n,r,i;return w.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:return n=t.sent,t.next=5,n.blob();case 5:return r=t.sent,t.next=8,createImageBitmap(r);case 8:return i=t.sent,t.abrupt("return",i);case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()}},node:function(t){var e=t.DOMParser,n=t.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:t.fetch,createCanvas:n.createCanvas,createImage:n.loadImage}}});e.default=xn}.call(e,n("Xm2t"))},RXKi:function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},TFFM:function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),o=new E(r||[]);return a._invoke=function(t,e,n){var r=l;return function(i,a){if(r===f)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return T()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=P(o,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=h(t,e,n);if("normal"===u.type){if(r=n.done?g:c,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}(t,n,o),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l="suspendedStart",c="suspendedYield",f="executing",g="completed",d={};function y(){}function p(){}function v(){}var m={};m[a]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(M([])));b&&b!==n&&r.call(b,a)&&(m=b);var w=v.prototype=y.prototype=Object.create(m);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,i){function a(){return new Promise(function(e,a){!function e(n,i,a,o){var s=h(t[n],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,a,o)},function(t){e("throw",t,a,o)}):Promise.resolve(l).then(function(t){u.value=t,a(u)},function(t){return e("throw",t,a,o)})}o(s.arg)}(n,i,e,a)})}return e=e?e.then(a,a):a()}}function P(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=h(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function M(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}return{next:T}}function T(){return{value:e,done:!0}}return p.prototype=w.constructor=v,v.constructor=p,v[s]=p.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i){var a=new S(u(e,n,r,i));return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(w),w[s]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=M,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),h=r.call(o,"finallyLoc");if(u&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},UqQ9:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},Xm2t:function(t,e){var n,r,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,h=[],l=!1,c=-1;function f(){l&&u&&(l=!1,u.length?h=u.concat(h):c=-1,h.length&&g())}function g(){if(!l){var t=s(f);l=!0;for(var e=h.length;e;){for(u=h,h=[];++c<e;)u&&u[c].run();c=-1,e=h.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new d(t,e)),1!==h.length||l||s(g)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},dR2v:function(t,e,n){(function(e){(function(){var n,r,i,a,o,s;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:void 0!==e&&null!==e&&e.hrtime?(t.exports=function(){return(n()-o)/1e6},r=e.hrtime,a=(n=function(){var t;return 1e9*(t=r())[0]+t[1]})(),s=1e9*e.uptime(),o=a-s):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(e,n("Xm2t"))},eYbk:function(t,e,n){var r=n("wSZt"),i=n("AKLy");t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},gqWF:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},kdhv:function(t,e,n){(function(e){for(var r=n("dR2v"),i="undefined"==typeof window?e:window,a=["moz","webkit"],o="AnimationFrame",s=i["request"+o],u=i["cancel"+o]||i["cancelRequest"+o],h=0;!s&&h<a.length;h++)s=i[a[h]+"Request"+o],u=i[a[h]+"Cancel"+o]||i[a[h]+"CancelRequest"+o];if(!s||!u){var l=0,c=0,f=[];s=function(t){if(0===f.length){var e=r(),n=Math.max(0,1e3/60-(e-l));l=n+e,setTimeout(function(){var t=f.slice(0);f.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(l)}catch(t){setTimeout(function(){throw t},0)}},Math.round(n))}return f.push({handle:++c,callback:t,cancelled:!1}),c},u=function(t){for(var e=0;e<f.length;e++)f[e].handle===t&&(f[e].cancelled=!0)}}t.exports=function(t){return s.call(i,t)},t.exports.cancel=function(){u.apply(i,arguments)},t.exports.polyfill=function(t){t||(t=i),t.requestAnimationFrame=s,t.cancelAnimationFrame=u}}).call(e,n("VTyh"))},l3u9:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},r1fo:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},v2Fs:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},wSZt:function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n}});
//# sourceMappingURL=canvg.map.js